2016-07-27 120 views
0

我使用Scala的对HBase的表失败incrementColumnValue HBASE火花斯卡拉

所以运营,我有

val myTable = new HTable(hbase_conf, tbl_name) 

然后,我尝试使用这个命令增加一个值:

myTable.incrementColumnValue(
    "rowkey".getBytes, 
    "data".getBytes, 
    "count".getBytes, 
    1) 

我得到的结果是hbase shell

hbase(main):047:0> get 'test_marketing', 'rowkey', {COLUMN => 'data:count', VERSIONS =>2} 


    COLUMN      CELL 
    data:count    timestamp=1469614608636, value=\x00\x00\x00\x00\x00\x00\x00\x02 
    data:count    timestamp=1469614608609, value=\x00\x00\x00\x00\x00\x00\x00\x01 
    2 row(s) in 0.0100 seconds 

我怎样才能得到合理的价值?

回答

1

有一个get_counter命令,在hbase shell

尝试:

get_counter 'test_marketing', 'rowkey', 'data:count' 
+0

谢谢。 有没有办法像常规专栏一样使用计数器? 另外,当我将HUE用作HBase UI时,通常无法看到此列值 –