Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # dev >> Was HBASE-3817 really fixed? (HBase Shell has an issue accepting FILTER for the 'scan' command.)


Copy link to this message
-
Was HBASE-3817 really fixed? (HBase Shell has an issue accepting FILTER for the 'scan' command.)
Hi,

I saw an issue about using filter in scan on shell was reported as fixed in
version 0.92.0 from (https://issues.apache.org/jira/browse/HBASE-3817), but
it seems using a filter still makes the hbase shell disfunctioning in
0.92.1. Can anyone else reproduce this issue?
Script to reproduce
=========(In hbase shell)

disable 'test'
drop 'test'
create 'test',{NAME=>'cf',VERSIONS=>1}
put 'test','r1','cf:u','v1'
put 'test','r2','cf:u','v2'
put 'test','r3','cf:u','v3'
put 'test','r3','cf:u','v4'
hbase(main):001:0> scan 'test', {COLUMNS=>"cf:u"}
ROW
COLUMN+CELL
 r1                       column=cf:u, timestamp=1347555442241,
value=v1
 r2                       column=cf:u, timestamp=1347555442261,
value=v2
 r3                       column=cf:u, timestamp=1347555442328,
value=v4
3 row(s) in 0.5350 seconds

hbase(main):002:0> import org.apache.hadoop.hbase.filter.CompareFilter
=> Java::OrgApacheHadoopHbaseFilter::CompareFilter
hbase(main):003:0> import
org.apache.hadoop.hbase.filter.SingleColumnValueFilter
=> Java::OrgApacheHadoopHbaseFilter::SingleColumnValueFilter
hbase(main):004:0> import org.apache.hadoop.hbase.filter.SubstringComparator
=> Java::OrgApacheHadoopHbaseFilter::SubstringComparator
hbase(main):005:0> import org.apache.hadoop.hbase.util.Bytes
=> Java::OrgApacheHadoopHbaseUtil::Bytes
hbase(main):006:0> scan 'test', {COLUMNS=>"cf:u",
FILTER=>SingleColumnValueFilter.new (Bytes.toBytes('cf'),
Bytes.toBytes('u'), CompareFilter::CompareOp.valueOf('EQUAL'),
SubstringComparator.new('v1') }
hbase(main):007:1> scan 'test', {COLUMNS=>"cf:u"}
hbase(main):008:1> list
hbase(main):009:1>

No result returned after the scan+filter command.

Thanks,

Shumin Wu