You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Nick Dimiduk (JIRA)" <ji...@apache.org> on 2013/09/16 23:41:55 UTC
[jira] [Created] (HBASE-9549) shell get command does not
distinguish between family scan and empty qualifier
Nick Dimiduk created HBASE-9549:
-----------------------------------
Summary: shell get command does not distinguish between family scan and empty qualifier
Key: HBASE-9549
URL: https://issues.apache.org/jira/browse/HBASE-9549
Project: HBase
Issue Type: Bug
Components: shell
Reporter: Nick Dimiduk
Assignee: Nick Dimiduk
Priority: Minor
The shell is commonly used as a simple way to validate assumptions about the hbase data model. In this particular case, the shell behaves slightly differently from the HTable interface.
{noformat}
# shell interactions with KV with an empty qualifier
hbase(main):001:0> create 'foo', 'f1'
0 row(s) in 1.4130 seconds
=> Hbase::Table - foo
hbase(main):002:0> put 'foo', 'rk1', 'f1:', 'empty?'
0 row(s) in 0.0750 seconds # <= put works
hbase(main):003:0> put 'foo', 'rk1', 'f1:bar', 'value'
0 row(s) in 0.0070 seconds
# attempt to retrieve just the kv with empty qualifier
hbase(main):004:0> get 'foo', 'rk1', 'f1:'
COLUMN CELL
f1: timestamp=1379363480020, value=empty?
f1:bar timestamp=1379363546360, value=value
2 row(s) in 0.0360 seconds # <= returns more than expected!
hbase(main):005:0> get 'foo', 'rk1', 'f1'
COLUMN CELL
f1: timestamp=1379363480020, value=empty?
f1:bar timestamp=1379363546360, value=value
2 row(s) in 0.0120 seconds
hbase(main):006:0> delete 'foo', 'rk1', 'f1:'
0 row(s) in 0.0290 seconds # <= delete works
hbase(main):007:0> get 'foo', 'rk1', 'f1:'
COLUMN CELL
f1:bar timestamp=1379363546360, value=value
1 row(s) in 0.0260 seconds
hbase(main):008:0> get 'foo', 'rk1', 'f1'
COLUMN CELL
f1:bar timestamp=1379363546360, value=value
1 row(s) in 0.0080 seconds
# restore the empty qual kv for HTable test
hbase(main):011:0> put 'foo', 'rk1', 'f1:', 'empty?'
0 row(s) in 0.0950 seconds
hbase(main):010:0> get 'foo', 'rk1', 'f1:'
COLUMN CELL
f1: timestamp=1379365262555, value=empty?
f1:bar timestamp=1379365134135, value=value
2 row(s) in 0.0290 seconds
hbase(main):011:0> get 'foo', 'rk1', 'f1'
COLUMN CELL
f1: timestamp=1379365262555, value=empty?
f1:bar timestamp=1379365134135, value=value
2 row(s) in 0.0080 seconds
hbase(main):012:0> hconf = org.apache.hadoop.hbase.HBaseConfiguration.create()
=> #<Java::OrgApacheHadoopConf::Configuration:0x208e2fb5>
hbase(main):013:0> t = org.apache.hadoop.hbase.client.HTable.new(hconf,'foo')
=> #<Java::OrgApacheHadoopHbaseClient::HTable:0x437d51a6>
# create a Get requesting the empty qualifier only, works
hbase(main):014:0> g1 = org.apache.hadoop.hbase.client.Get.new(org.apache.hadoop.hbase.util.Bytes.toBytes('rk1'))
=> #<Java::OrgApacheHadoopHbaseClient::Get:0x796523ab>
hbase(main):015:0> g1.addColumn(org.apache.hadoop.hbase.util.Bytes.toBytes('f1'), nil)
=> #<Java::OrgApacheHadoopHbaseClient::Get:0x796523ab>
hbase(main):016:0> t.get(g1).toString()
=> "keyvalues={rk1/f1:/1379365262555/Put/vlen=6/mvcc=0}"
# create a Get requesting the whole family, works
hbase(main):017:0> g2 = org.apache.hadoop.hbase.client.Get.new(org.apache.hadoop.hbase.util.Bytes.toBytes('rk1'))
=> #<Java::OrgApacheHadoopHbaseClient::Get:0x52e5376a>
hbase(main):018:0> g2.addFamily(org.apache.hadoop.hbase.util.Bytes.toBytes('f1'))
=> #<Java::OrgApacheHadoopHbaseClient::Get:0x52e5376a>
hbase(main):019:0> t.get(g2).toString()
=> "keyvalues={rk1/f1:/1379365262555/Put/vlen=6/mvcc=0, rk1/f1:bar/1379365134135/Put/vlen=5/mvcc=0}"
{noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira