[
https://issues.apache.org/jira/browse/HBASE-9942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13824263#comment-13824263
]
stack commented on HBASE-9942:
------------------------------
Ruby constants are not 'constant' -- there is no such thing as a constant in
ruby it seems -- so what is happening here is that the 'constant' STARTROW gets
assigned the value 'row4'; ditto for STOPROW with its 'row7' or whatever. We
then use this 'constant' key doing a lookup in the dictionary of submitted
values for CF by doing args[STARTROW]. Because the 'constant' is not 'row4'
rather than 'STARTROW', we find nothing and take the default ''.
In ruby, when you set a 'constant', it gives you a 'warning' but then goes
ahead and sets it anyways. Here is an illustration where I set a 'constant'
using a java constant.
hbase(main):002:0* NAME = org.apache.hadoop.hbase.HConstants::NAME
=> "NAME"
hbase(main):003:0> NAME = 'xyz'
(hbase):3 warning: already initialized constant NAME
=> "xyz"
Not sure what to do about this one. We might have to put it down to the
joys-of-ruby? Ideas?
> hbase Scanner specifications accepting wrong specifier and then after scan
> using correct specifier returning unexpected result
> -------------------------------------------------------------------------------------------------------------------------------
>
> Key: HBASE-9942
> URL: https://issues.apache.org/jira/browse/HBASE-9942
> Project: HBase
> Issue Type: Bug
> Components: Client
> Affects Versions: 0.96.0, 0.94.13
> Reporter: Deepak Sharma
> Priority: Minor
> Fix For: 0.96.1
>
>
> check the given scenerio:
> 1. log in to hbase client --> ./hbase shell
> 2. created table 'tab1'
> hbase(main):001:0> create 'tab1' , 'fa1'
> 3. put some 10 rows (row1 to row10) in table 'tab1'
> 4. run the scan for table 'tab1' as follows:
>
> hbase(main):013:0> scan 'tab1' , { STARTROW => 'row4' , STOPROW => 'row9' }
> ROW COLUMN+CELL
>
>
> row4 column=fa1:col1,
> timestamp=1384164182738, value=value1
>
> row5 column=fa1:col1,
> timestamp=1384164188396, value=value1
>
> row6 column=fa1:col1,
> timestamp=1384164192395, value=value1
>
> row7 column=fa1:col1,
> timestamp=1384164197693, value=value1
>
> row8 column=fa1:col1,
> timestamp=1384164203237, value=value1
>
> 5 row(s) in 0.0540 seconds
> so result was expected , rows from 'row4' to 'row8' are displayed
> 5. then run the scan using wrong specifier ( '=' instead of '=>') so get
> wrong result
> hbase(main):014:0> scan 'tab1' , { STARTROW = 'row4' , STOPROW = 'row9' }
> ROW COLUMN+CELL
>
>
> row1 column=fa1:col1,
> timestamp=1384164167838, value=value1
>
> row10 column=fa1:col1,
> timestamp=1384164212615, value=value1
>
> row2 column=fa1:col1,
> timestamp=1384164175337, value=value1
>
> row3 column=fa1:col1,
> timestamp=1384164179068, value=value1
>
> row4 column=fa1:col1,
> timestamp=1384164182738, value=value1
>
> row5 column=fa1:col1,
> timestamp=1384164188396, value=value1
>
> row6 column=fa1:col1,
> timestamp=1384164192395, value=value1
>
> row7 column=fa1:col1,
> timestamp=1384164197693, value=value1
>
> row8 column=fa1:col1,
> timestamp=1384164203237, value=value1
>
> row9 column=fa1:col1,
> timestamp=1384164208375, value=value1
>
> 10 row(s) in 0.0390 seconds
> 6. now performed correct scan query with correct specifier ( used '=>' as
> specifier)
> hbase(main):015:0> scan 'tab1' , { STARTROW => 'row4' , STOPROW => 'row9' }
> ROW COLUMN+CELL
>
>
> row1 column=fa1:col1,
> timestamp=1384164167838, value=value1
>
> row10 column=fa1:col1,
> timestamp=1384164212615, value=value1
>
> row2 column=fa1:col1,
> timestamp=1384164175337, value=value1
>
> row3 column=fa1:col1,
> timestamp=1384164179068, value=value1
>
> row4 column=fa1:col1,
> timestamp=1384164182738, value=value1
>
> row5 column=fa1:col1,
> timestamp=1384164188396, value=value1
>
> row6 column=fa1:col1,
> timestamp=1384164192395, value=value1
>
> row7 column=fa1:col1,
> timestamp=1384164197693, value=value1
>
> row8 column=fa1:col1,
> timestamp=1384164203237, value=value1
>
> row9 column=fa1:col1,
> timestamp=1384164208375, value=value1
>
> 10 row(s) in 0.0450 seconds
> now even if i have passed correct scan query then also i am getting wrong
> result
> Defect:
> check in step 6 as per scan query , only row4 to row9 should be displayed but
> output result is displaying all the rows in this table
> Note: when i exit the shell and again loging and perform the same query then
> result was correct
--
This message was sent by Atlassian JIRA
(v6.1#6144)