本文介绍了Hbase shell:价值被削减的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为'mytable'的hbase表,只有一个列族'default',只有一个限定符'details'。

现在我执行这个查询:

  get'mytable','test'

结果的值被削减。它应该是一个数字(长):

  COLUMN CELL 
default:details timestamp = 1337007859494,value = \ x00 \x00\x00\x00\x00\x00\xDFH
1行(s)在0.0360秒

为什么我只看到前七个字节?我怎样才能看到完整的价值?



如果我要求一个小值的东西,它会起作用。但是大的值是不完整的。

解决方案
你的long的所有8个字节都在那个字符串中:

  \x00\x00\x00\x00\x00\x00\xDFH 

更容易看到:

  \x00 \\ \\ x00 \x00 \x00 \x00 \x00 \xDF H 

前6个字节是0(十六进制\x00),下一个是223(十六进制\ DXF),最后是ASCII H(\ x48),这使得你的长十进制57,160。 HBase的值只是字符数组,而不能识别类型,因此shell以十六进制形式转义所有不是可打印ASCII的字节,而只留下那些不是最清晰的字节。


I've got a hbase table named 'mytable' with only one column family 'default' and only one qualifier 'details'.

Now I do this query:

get 'mytable', 'test'

And the value of the result is cut. It should be a number (long):

COLUMN                      CELL
default:details            timestamp=1337007859494, value=\x00\x00\x00\x00\x00\x00\xDFH
1 row(s) in 0.0360 seconds

Why do I only see the first seven bytes? How can I see the full value?

If I ask for something with a small value, it works. But big values are incomplete.

解决方案

All 8 bytes of your long are in that string:

\x00\x00\x00\x00\x00\x00\xDFH

Easier to see this way:

\x00 \x00 \x00 \x00 \x00 \x00 \xDF H

The first 6 bytes are 0 (hex \x00), the next one is 223 (hex \xDF) and the last is ASCII H (\x48), this makes your long in decimal 57,160. HBase's values are just character arrays and not type aware so the shell escapes as hex all bytes that are not printable ASCII and leaves alone ones that are, not always the clearest.

这篇关于Hbase shell:价值被削减的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 08:07