欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-03-24 09:03:12
今天比较开心,只想哈哈~哈哈哈~ 啥也不多说了,直接看示例吧!绝对比我口才好~ 哈哈!Get到了吗?好意思不帮我分享嘛~哈哈~ 转载请注明出处!欢迎关注本人微信公众号【HBase工作笔记】 ......

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

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 Shell 命令行正常查看十六进制编码的中文?哈哈~

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