无法使用 spark scala 增加 ColumnValue HBASE
Fail to incrementColumnValue HBASE with spark scala
我用Scala操作Hbasetable
所以,我有
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
我怎样才能得到一个合理的结果值?
hbase shell
中有一个get_counter
命令:
尝试:
get_counter 'test_marketing', 'rowkey', 'data:count'
我用Scala操作Hbasetable
所以,我有
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
我怎样才能得到一个合理的结果值?
hbase shell
中有一个get_counter
命令:
尝试:
get_counter 'test_marketing', 'rowkey', 'data:count'