当前位置: 移动技术网 > IT编程>数据库>其他数据库 > 如何在 HBase Shell 命令行正常查看十六进制编码的中文?哈哈~

如何在 HBase Shell 命令行正常查看十六进制编码的中文?哈哈~

2020年04月28日  | 移动技术网IT编程  | 我要评论

瑞典公开赛,公主恋人全集,江同聊天室

今天比较开心,只想哈哈哈哈哈
啥也不多说了,直接看示例吧!绝对比我口才好~

hbase(main):050:0> scan 'test'
row                                              column+cell
 row-1                                           column=f:c1, timestamp=1587984555307, value=\xe7\xa6\x85\xe5\x85\x8b
 row-2                                           column=f:c2, timestamp=1587984555307, value=hbase\xe8\x80\x81\xe5\xba\x97
 row-3                                           column=f:c3, timestamp=1587984555307, value=hbase\xe5\xb7\xa5\xe4\xbd\x9c\xe7\xac\x94\xe8\xae\xb0
 row-4                                           column=f:c4, timestamp=1587984555307, value=\xe6\x88\x91\xe7\x88\xb1\xe4\xbd\xa0\xe4\xb8\xad\xe5\x9b\xbd\xef\xbc\x81
4 row(s) in 0.0190 seconds

hbase(main):051:0> scan 'test', {formatter => 'tostring'}
row                                              column+cell
 row-1                                           column=f:c1, timestamp=1587984555307, value=禅克
 row-2                                           column=f:c2, timestamp=1587984555307, value=hbase老店
 row-3                                           column=f:c3, timestamp=1587984555307, value=hbase工作笔记
 row-4                                           column=f:c4, timestamp=1587984555307, value=我爱你中国!
4 row(s) in 0.0170 seconds

hbase(main):052:0> scan 'test', {formatter => 'tostring',limit=>1,column=>'f:c4'}
row                                              column+cell
 row-4                                           column=f:c4, timestamp=1587984555307, value=我爱你中国!
1 row(s) in 0.0180 seconds

hbase(main):053:0> scan 'test', {formatter_class => 'org.apache.hadoop.hbase.util.bytes', formatter => 'tostring'}
row                                              column+cell
 row-1                                           column=f:c1, timestamp=1587984555307, value=禅克
 row-2                                           column=f:c2, timestamp=1587984555307, value=hbase老店
 row-3                                           column=f:c3, timestamp=1587984555307, value=hbase工作笔记
 row-4                                           column=f:c4, timestamp=1587984555307, value=我爱你中国!
4 row(s) in 0.0220 seconds

hbase(main):054:0> scan 'test', {formatter_class => 'org.apache.hadoop.hbase.util.bytes', formatter => 'tostring', column=>'f:c4'}
row                                              column+cell
 row-4                                           column=f:c4, timestamp=1587984555307, value=我爱你中国!
1 row(s) in 0.0220 seconds

hbase(main):004:0> scan 'test', {columns => ['f:c1:tostring','f:c2:tostring'] }
row                                              column+cell
 row-1                                           column=f:c1, timestamp=1587984555307, value=禅克
 row-2                                           column=f:c2, timestamp=1587984555307, value=hbase老店
2 row(s) in 0.0180 seconds

hbase(main):003:0> scan 'test', {columns => ['f:c1:c(org.apache.hadoop.hbase.util.bytes).tostring','f:c3:c(org.apache.hadoop.hbase.util.bytes).tostring'] }
row                                              column+cell
 row-1                                           column=f:c1, timestamp=1587984555307, value=禅克
 row-3                                           column=f:c3, timestamp=1587984555307, value=hbase工作笔记
2 row(s) in 0.0160 seconds

hbase(main):055:0> scan 'test', {columns => ['f:c1:tostring','f:c4:c(org.apache.hadoop.hbase.util.bytes).tostring'] }
row                                              column+cell
 row-1                                           column=f:c1, timestamp=1587984555307, value=禅克
 row-4                                           column=f:c4, timestamp=1587984555307, value=我爱你中国!
2 row(s) in 0.0290 seconds

hbase(main):058:0> get 'test','row-2','f:c2:tostring'
column                                           cell
 f:c2                                            timestamp=1587984555307, value=get到了吗?好意思不帮我分享嘛~哈哈~
1 row(s) in 0.0070 seconds

hbase(main):057:0>

哈哈!get到了吗?好意思不帮我分享嘛哈哈

扫描二维码关注博主公众号

转载请注明出处!欢迎关注本人微信公众号【hbase工作笔记】

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网