Browse Source

Allow scans with pefix '0'

Bosko Devetak 4 years ago
parent
commit
cc04f4c610
1 changed files with 5 additions and 5 deletions
  1. 5 5
      lib/HBase/JSONRest/Scanner.pm

+ 5 - 5
lib/HBase/JSONRest/Scanner.pm

@ -70,7 +70,7 @@ sub get_next_batch {
70 70
    if ($self->{batch_no} == 0) {
71 71
72 72
        # Case I:
73
        if ($prefix && !$self->{startrow} && !$self->{endrow}) {
73
        if ((defined $prefix) && !$self->{startrow} && !$self->{endrow}) {
74 74
75 75
            my $first_row = $self->_get_first_row_of_prefix();
76 76
@ -82,23 +82,23 @@ sub get_next_batch {
82 82
        }
83 83
        # Case II:
84 84
        # case no prefix, startrow exists, endrow exists
85
        elsif (!$prefix && $self->{startrow} && $self->{endrow}){
85
        elsif ((!defined $prefix) && $self->{startrow} && $self->{endrow}){
86 86
            # $self->{startrow} allready assigned
87 87
            $self->{end_condition_type} = 'ENDROW';
88 88
        }
89 89
        # Case III:
90 90
        # only firs_key specified, scan untill the end of the table
91
        elsif (!$prefix && $self->{startrow} && !$self->{endrow}){
91
        elsif ((!defined $prefix) && $self->{startrow} && !$self->{endrow}){
92 92
            # $self->{startrow} allready assigned
93 93
            $self->{end_condition_type} = 'NONE';
94 94
        }
95 95
        # Forbiden cases:
96 96
        #   case prefix and startrow/endrow
97
        elsif ($prefix && ($self->{startrow} || $self->{endrow})){
97
        elsif ((defined $prefix) && ($self->{startrow} || $self->{endrow})){
98 98
            die "Can not use prefix and startrow/endrow at the same time!";
99 99
        }
100 100
        #   case no params
101
        elsif (!$prefix && !$self->{startrow}) {
101
        elsif ((!defined $prefix) && !$self->{startrow}) {
102 102
            die "Must specify either prefix or startrow!";
103 103
        }
104 104
        else {