1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
| [root@hadoop01 conf]# hbase shell 2023-03-31 20:06:06,069 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable HBase Shell Use "help" to get list of supported commands. Use "exit" to quit this interactive shell. Version 2.0.2, r1cfab033e779df840d5612a85277f42a6a4e8172, Tue Aug 28 20:50:40 PDT 2018 Took 0.0022 seconds hbase(main):001:0> create 'student','info'.'score' SyntaxError: (hbase):1: syntax error, unexpected tSTRING_BEG create 'student','info'.'score'
hbase(main):002:0> create 'student','info','score' Created table student Took 2.2020 seconds => Hbase::Table - student hbase(main):003:0> list TABLE student 1 row(s) Took 0.0968 seconds => ["student"] hbase(main):004:0> put 'student','1001','info:name','Graay' Took 0.6300 seconds hbase(main):006:0> put 'student','1001','info:age','18' Took 0.0259 seconds hbase(main):007:0> scan 'student' ROW COLUMN+CELL 1001 column=info:age, timestamp=1680318580788, value=18 1001 column=info:name, timestamp=1680318521517, value=Gra ay 1 row(s) Took 0.1029 seconds hbase(main):008:0> put 'student','1002','info:age','21' Took 0.0161 seconds hbase(main):009:0> scan 'student' ROW COLUMN+CELL 1001 column=info:age, timestamp=1680318580788, value=18 1001 column=info:name, timestamp=1680318521517, value=Gra ay 1002 column=info:age, timestamp=1680318604807, value=21 2 row(s) Took 0.0136 seconds hbase(main):010:0> describe 'student' Table student is ENABLED student COLUMN FAMILIES DESCRIPTION {NAME => 'info', VERSIONS => '1', EVICT_BLOCKS_ON_CLOSE => 'false', NEW _VERSION_BEHAVIOR => 'false', KEEP_DELETED_CELLS => 'FALSE', CACHE_DATA _ON_WRITE => 'false', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', CA CHE_INDEX_ON_WRITE => 'false', IN_MEMORY => 'false', CACHE_BLOOMS_ON_WR ITE => 'false', PREFETCH_BLOCKS_ON_OPEN => 'false', COMPRESSION => 'NON E', BLOCKCACHE => 'true', BLOCKSIZE => '65536'} {NAME => 'score', VERSIONS => '1', EVICT_BLOCKS_ON_CLOSE => 'false', NE W_VERSION_BEHAVIOR => 'false', KEEP_DELETED_CELLS => 'FALSE', CACHE_DAT A_ON_WRITE => 'false', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', MIN_VERSIONS => '0', REPLICATION_SCOPE => '0', BLOOMFILTER => 'ROW', C ACHE_INDEX_ON_WRITE => 'false', IN_MEMORY => 'false', CACHE_BLOOMS_ON_W RITE => 'false', PREFETCH_BLOCKS_ON_OPEN => 'false', COMPRESSION => 'NO NE', BLOCKCACHE => 'true', BLOCKSIZE => '65536'} 2 row(s) Took 0.2478 seconds hbase(main):011:0> get 'student','1001' COLUMN CELL info:age timestamp=1680318580788, value=18 info:name timestamp=1680318521517, value=Graay 1 row(s) Took 0.1066 seconds hbase(main):012:0> count 'student' 2 row(s) Took 0.0993 seconds => 2 hbase(main):013:0> delete 'student','1002','info:sex' Took 0.0651 seconds hbase(main):014:0> deleteall 'student','1001' Took 0.0595 seconds hbase(main):017:0> truncate 'student' Truncating 'student' table (it may take a while): Disabling table... Truncating table... Took 2.8205 seconds hbase(main):019:0> scan 'student' ROW COLUMN+CELL 0 row(s) Took 1.4101 seconds hbase(main):020:0> disable 'student' Took 0.5823 seconds hbase(main):021:0> drop 'student' Took 0.5392 seconds hbase(main):022:0>
|
评论区
欢迎你留下宝贵的意见,昵称输入QQ号会显示QQ头像哦~