hbase shell 表操作記錄
阿新 • • 發佈:2019-02-07
hbase(main):001:0> create 'pddtbtest','member_id','address','info'
0 row(s) in 1.4350 seconds
=> Hbase::Table - pddtbtest
hbase(main):002:0> list
TABLE
pddtbtest
9 row(s) in 0.0150 seconds
=> ["goods_check:goods_commit_history", "goods_check:goods_commit_history_index", "goods_check:goods_commit_trash", "goods_check:sku_commit_history", "goods_check:sku_commit_trash", "pddtbtest", "vodka:goods_operate_log", "vodka:out_sku_map_by_id", "vodka:out_sku_map_by_out_sn"]
hbase(main):003:0> exist 'pddtbtest'
NoMethodError: undefined method `exist' for #<Object:0x3c28e5b6>
hbase(main):004:0> exists 'pddtbtet'
Table pddtbtet does not exist
0 row(s) in 0.0570 seconds
hbase(main):005:0> exists 'pddtbtest'
Table pddtbtest does exist
0 row(s) in 0.0110 seconds
hbase(main):006:0> put'pddtbtest','scutshuxue','info:age','24'
0 row(s) in 0.0770 seconds
hbase(main):007:0>
Display all 487 possibilities? (y or n)
hbase(main):007:0> fo:birthday','1987-06-17'
hbase(main):008:0'
hbase(main):009:0'
hbase(main):010:0'
hbase(main):011:0' \r
hbase(main):012:0'
hbase(main):013:0'
hbase(main):014:0'
hbase(main):015:0' ;
hbase(main):016:0' ;
hbase(main):017:0' exit
hbase(main):018:0' [ [email protected]] /data0$
[[email protected]] /data0$
[[email protected]] /data0$ hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.4.2.0-258/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.4.2.0-258/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.1.2.2.4.2.0-258, rUnknown, Mon Apr 25 06:36:21 UTC 2016
hbase(main):001:0> put'pddtbtest','scutshuxue','info:birthday','1987-06-17'
0 row(s) in 0.1980 seconds
hbase(main):002:0> put'pddtbtest','scutshuxue','info:company','alibaba'
0 row(s) in 0.0070 seconds
hbase(main):003:0> put'pddtbtest','scutshuxue','address:contry','china'
0 row(s) in 0.0070 seconds
hbase(main):004:0> put'pddtbtest','scutshuxue','address:province','zhejiang'
0 row(s) in 0.0100 seconds
hbase(main):005:0> put'pddtbtest','scutshuxue','address:city','hangzhou'
0 row(s) in 0.0060 seconds
hbase(main):006:0>
hbase(main):009:0> put'pddtbtest','tim','info:age','23'
0 row(s) in 0.0070 seconds
hbase(main):010:0> put'pddtbtest','tim','info:birthday','1988-06-17'
0 row(s) in 0.0070 seconds
hbase(main):011:0> put'pddtbtest','tim','info:company','alibaba'
0 row(s) in 0.0060 seconds
hbase(main):012:0> put'pddtbtest','tim','address:contry','china'
0 row(s) in 0.0060 seconds
hbase(main):013:0> put'pddtbtest','tim','address:province','shanghai'
0 row(s) in 0.0070 seconds
hbase(main):014:0> put'pddtbtest','tim','address:city','pudong'
0 row(s) in 0.0060 seconds
hbase(main):015:0> scan 'pddtbtest'
ROW COLUMN+CELL
scutshuxue column=address:city, timestamp=1516020224640, value=hangzhou
scutshuxue column=address:contry, timestamp=1516020214801, value=china
scutshuxue column=address:province, timestamp=1516020219463, value=zhejiang
scutshuxue column=info:age, timestamp=1516020164614, value=24
scutshuxue column=info:birthday, timestamp=1516020202325, value=1987-06-17
scutshuxue column=info:company, timestamp=1516020208212, value=alibaba
tim column=address:city, timestamp=1516020394891, value=pudong
tim column=address:contry, timestamp=1516020386280, value=china
tim column=address:province, timestamp=1516020390185, value=shanghai
tim column=info:age, timestamp=1516020373026, value=23
tim column=info:birthday, timestamp=1516020377752, value=1988-06-17
tim column=info:company, timestamp=1516020381736, value=alibaba
2 row(s) in 0.0180 seconds
hbase(main):016:0>
0 row(s) in 1.4350 seconds
=> Hbase::Table - pddtbtest
hbase(main):002:0> list
TABLE
pddtbtest
9 row(s) in 0.0150 seconds
=> ["goods_check:goods_commit_history", "goods_check:goods_commit_history_index", "goods_check:goods_commit_trash", "goods_check:sku_commit_history", "goods_check:sku_commit_trash", "pddtbtest", "vodka:goods_operate_log", "vodka:out_sku_map_by_id", "vodka:out_sku_map_by_out_sn"]
hbase(main):003:0> exist 'pddtbtest'
NoMethodError: undefined method `exist' for #<Object:0x3c28e5b6>
hbase(main):004:0> exists 'pddtbtet'
Table pddtbtet does not exist
0 row(s) in 0.0570 seconds
hbase(main):005:0> exists 'pddtbtest'
Table pddtbtest does exist
0 row(s) in 0.0110 seconds
hbase(main):006:0> put'pddtbtest','scutshuxue','info:age','24'
0 row(s) in 0.0770 seconds
hbase(main):007:0>
Display all 487 possibilities? (y or n)
hbase(main):007:0> fo:birthday','1987-06-17'
hbase(main):008:0'
hbase(main):009:0'
hbase(main):010:0'
hbase(main):011:0' \r
hbase(main):012:0'
hbase(main):013:0'
hbase(main):014:0'
hbase(main):015:0' ;
hbase(main):016:0' ;
hbase(main):017:0' exit
hbase(main):018:0' [
[[email protected]] /data0$
[[email protected]] /data0$ hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.4.2.0-258/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.4.2.0-258/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.1.2.2.4.2.0-258, rUnknown, Mon Apr 25 06:36:21 UTC 2016
hbase(main):001:0> put'pddtbtest','scutshuxue','info:birthday','1987-06-17'
0 row(s) in 0.1980 seconds
hbase(main):002:0> put'pddtbtest','scutshuxue','info:company','alibaba'
0 row(s) in 0.0070 seconds
hbase(main):003:0> put'pddtbtest','scutshuxue','address:contry','china'
0 row(s) in 0.0070 seconds
hbase(main):004:0> put'pddtbtest','scutshuxue','address:province','zhejiang'
0 row(s) in 0.0100 seconds
hbase(main):005:0> put'pddtbtest','scutshuxue','address:city','hangzhou'
0 row(s) in 0.0060 seconds
hbase(main):006:0>
hbase(main):009:0> put'pddtbtest','tim','info:age','23'
0 row(s) in 0.0070 seconds
hbase(main):010:0> put'pddtbtest','tim','info:birthday','1988-06-17'
0 row(s) in 0.0070 seconds
hbase(main):011:0> put'pddtbtest','tim','info:company','alibaba'
0 row(s) in 0.0060 seconds
hbase(main):012:0> put'pddtbtest','tim','address:contry','china'
0 row(s) in 0.0060 seconds
hbase(main):013:0> put'pddtbtest','tim','address:province','shanghai'
0 row(s) in 0.0070 seconds
hbase(main):014:0> put'pddtbtest','tim','address:city','pudong'
0 row(s) in 0.0060 seconds
hbase(main):015:0> scan 'pddtbtest'
ROW COLUMN+CELL
scutshuxue column=address:city, timestamp=1516020224640, value=hangzhou
scutshuxue column=address:contry, timestamp=1516020214801, value=china
scutshuxue column=address:province, timestamp=1516020219463, value=zhejiang
scutshuxue column=info:age, timestamp=1516020164614, value=24
scutshuxue column=info:birthday, timestamp=1516020202325, value=1987-06-17
scutshuxue column=info:company, timestamp=1516020208212, value=alibaba
tim column=address:city, timestamp=1516020394891, value=pudong
tim column=address:contry, timestamp=1516020386280, value=china
tim column=address:province, timestamp=1516020390185, value=shanghai
tim column=info:age, timestamp=1516020373026, value=23
tim column=info:birthday, timestamp=1516020377752, value=1988-06-17
tim column=info:company, timestamp=1516020381736, value=alibaba
2 row(s) in 0.0180 seconds
hbase(main):016:0>