You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Shumin Wu <sh...@gmail.com> on 2012/09/13 19:06:05 UTC
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
Re: Was HBASE-3817 really fixed? (HBase Shell has an issue accepting
FILTER for the 'scan' command.)
Posted by Shumin Wu <sh...@gmail.com>.
Hi Norbert,
Thanks for your reply and nice to see you here in the community. I tried
your version of query and found it worked fine. So that was just a false
alarm. But it is strange that my shell swallowed the prompt and suppressed
the subsequent query results. I am using the standard terminal on Ubuntu
12.04. Prompts on syntax check look okay on other queries with typos.
Shumin
On Tue, Sep 18, 2012 at 7:07 AM, Norbert Burger <no...@gmail.com>wrote:
> Hi Shumin, seems like the example provided is missing a closing
> rparen? Try changing, for example, the scan+filter line to be:
>
> scan 'test', {COLUMNS=>"cf:u", FILTER=>SingleColumnValueFilter.new
> (Bytes.toBytes('cf'), Bytes.toBytes('u'),
> CompareFilter::CompareOp.valueOf('EQUAL'),
> SubstringComparator.new('v1')) }
>
> Note the extra rparen at the end of the line. Odd that your prompt
> didn't change to indicate the parse error, in my version of the shell,
> the prompt's trailing '>' changes to an '*' to indicate this
> situation.
>
> Norbert
>
> On Thu, Sep 13, 2012 at 1:06 PM, Shumin Wu <sh...@gmail.com> wrote:
> > 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
>
Re: Was HBASE-3817 really fixed? (HBase Shell has an issue accepting
FILTER for the 'scan' command.)
Posted by Shumin Wu <sh...@gmail.com>.
Hi Norbert,
Thanks for your reply and nice to see you here in the community. I tried
your version of query and found it worked fine. So that was just a false
alarm. But it is strange that my shell swallowed the prompt and suppressed
the subsequent query results. I am using the standard terminal on Ubuntu
12.04. Prompts on syntax check look okay on other queries with typos.
Shumin
On Tue, Sep 18, 2012 at 7:07 AM, Norbert Burger <no...@gmail.com>wrote:
> Hi Shumin, seems like the example provided is missing a closing
> rparen? Try changing, for example, the scan+filter line to be:
>
> scan 'test', {COLUMNS=>"cf:u", FILTER=>SingleColumnValueFilter.new
> (Bytes.toBytes('cf'), Bytes.toBytes('u'),
> CompareFilter::CompareOp.valueOf('EQUAL'),
> SubstringComparator.new('v1')) }
>
> Note the extra rparen at the end of the line. Odd that your prompt
> didn't change to indicate the parse error, in my version of the shell,
> the prompt's trailing '>' changes to an '*' to indicate this
> situation.
>
> Norbert
>
> On Thu, Sep 13, 2012 at 1:06 PM, Shumin Wu <sh...@gmail.com> wrote:
> > 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
>
Re: Was HBASE-3817 really fixed? (HBase Shell has an issue accepting
FILTER for the 'scan' command.)
Posted by Norbert Burger <no...@gmail.com>.
Hi Shumin, seems like the example provided is missing a closing
rparen? Try changing, for example, the scan+filter line to be:
scan 'test', {COLUMNS=>"cf:u", FILTER=>SingleColumnValueFilter.new
(Bytes.toBytes('cf'), Bytes.toBytes('u'),
CompareFilter::CompareOp.valueOf('EQUAL'),
SubstringComparator.new('v1')) }
Note the extra rparen at the end of the line. Odd that your prompt
didn't change to indicate the parse error, in my version of the shell,
the prompt's trailing '>' changes to an '*' to indicate this
situation.
Norbert
On Thu, Sep 13, 2012 at 1:06 PM, Shumin Wu <sh...@gmail.com> wrote:
> 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
Re: Was HBASE-3817 really fixed? (HBase Shell has an issue accepting
FILTER for the 'scan' command.)
Posted by Norbert Burger <no...@gmail.com>.
Hi Shumin, seems like the example provided is missing a closing
rparen? Try changing, for example, the scan+filter line to be:
scan 'test', {COLUMNS=>"cf:u", FILTER=>SingleColumnValueFilter.new
(Bytes.toBytes('cf'), Bytes.toBytes('u'),
CompareFilter::CompareOp.valueOf('EQUAL'),
SubstringComparator.new('v1')) }
Note the extra rparen at the end of the line. Odd that your prompt
didn't change to indicate the parse error, in my version of the shell,
the prompt's trailing '>' changes to an '*' to indicate this
situation.
Norbert
On Thu, Sep 13, 2012 at 1:06 PM, Shumin Wu <sh...@gmail.com> wrote:
> 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