Browse Source

Merge branch 'dtcyganov-long-columns-names-fix'

Bosko Devetak 4 years ago
parent
commit
b5813bd510
2 changed files with 28 additions and 2 deletions
  1. 1 1
      lib/HBase/JSONRest.pm
  2. 27 1
      t/uri_gen.t

+ 1 - 1
lib/HBase/JSONRest.pm

@ -513,7 +513,7 @@ sub _build_get_uri {
513 513
                }
514 514
                else {
515 515
                    push @get_urls, { url => $current_url, len => length($current_url) };
516
                    $current_url = undef;
516
                    $current_url = $uri . "/" . uri_escape($column);
517 517
                }
518 518
            }
519 519
        }

+ 27 - 1
t/uri_gen.t

@ -2,7 +2,7 @@
2 2
use strict;
3 3
use warnings;
4 4
5
use Test::More tests => 10;
5
use Test::More tests => 11;
6 6
7 7
use HBase::JSONRest;
8 8
use HBase::JSONRest::Scanner;
@ -176,4 +176,30 @@ is_deeply(
176 176
        '/my_table/multiget?row=' . ( 5 x 800 ),
177 177
    ],
178 178
    q|Test multiget with long ids|
179
180
# 11. get with long columns names
181
is_deeply(
182
    [
183
        map { $_->{url} }
184
        @{ HBase::JSONRest::_build_get_uri({
185
            'table' => 'my_table',
186
            'where' => {
187
                'key_equals' => 1234567890
188
            },
189
            'columns' => [
190
                1 x 1000,
191
                2 x 1000,
192
                3 x 500,
193
                4 x 500,
194
                5 x 500,
195
            ]
196
        }) }
197
    ],
198
    [
199
        '/my_table/1234567890/' . ( 1 x 1000 ),
200
        '/my_table/1234567890/' . ( 2 x 1000 ),
201
        '/my_table/1234567890/' . ( 3 x 500 ) . ',' . (4 x 500),
202
        '/my_table/1234567890/' . ( 5 x 500 ),
203
    ],
204
    q|Test get with long columns names|
179 205
);