Some examples:
hbase> scan 'hbase:meta'
hbase> scan 'hbase:meta', {COLUMNS => 'info:regioninfo'}
hbase> scan 't1', {COLUMNS => ['c1', 'c2'], LIMIT => 10, STARTROW => 'xyz'}
hbase> scan 't1', {COLUMNS => 'c1', TIMERANGE => [1303668804, 1303668904]}
hbase> scan 't1', {REVERSED => true}
hbase> scan 't1', {FILTER => "(PrefixFilter ('row2') AND
(QualifierFilter (>=, 'binary:xyz'))) AND (TimestampsFilter ( 123, 456))"}
hbase> scan 't1', {FILTER =>
org.apache.hadoop.hbase.filter.ColumnPaginationFilter.new(1, 0)}
hbase> scan 't1', {CONSISTENCY => 'TIMELINE'}
For setting the Operation Attributes
hbase> scan 't1', { COLUMNS => ['c1', 'c2'], ATTRIBUTES => {'mykey' => 'myvalue'}}
hbase> scan 't1', { COLUMNS => ['c1', 'c2'], AUTHORIZATIONS => ['PRIVATE','SECRET']}
For experts, there is an additional option -- CACHE_BLOCKS -- which
switches block caching for the scanner on (true) or off (false). By
default it is enabled. Examples:
hbase> scan 't1', {COLUMNS => ['c1', 'c2'], CACHE_BLOCKS => false}
Also for experts, there is an advanced option -- RAW -- which instructs the
scanner to return all cells (including delete markers and uncollected deleted
cells). This option cannot be combined with requesting specific COLUMNS.
Disabled by default. Example:
hbase> scan 't1', {RAW => true, VERSIONS => 10}
Besides the default 'toStringBinary' format, 'scan' supports custom formatting
by column. A user can define a FORMATTER by adding it to the column name in
the scan specification. The FORMATTER can be stipulated:
1. either as a org.apache.hadoop.hbase.util.Bytes method name (e.g, toInt, toString)
2. or as a custom class followed by method name: e.g. 'c(MyFormatterClass).format'.
Example formatting cf:qualifier1 and cf:qualifier2 both as Integers:
hbase> scan 't1', {COLUMNS => ['cf:qualifier1:toInt',
'cf:qualifier2:c(org.apache.hadoop.hbase.util.Bytes).toInt'] }
Note that you can specify a FORMATTER by column only (cf:qualifer). You cannot
specify a FORMATTER for all columns of a column family.
Scan can also be used directly from a table, by first getting a reference to a
table, like such:
hbase> t = get_table 't'
hbase> t.scan
Note in the above situation, you can still provide all the filtering, columns,
options, etc as described above.
hbase(main):076:0> get 't1','rowkey001'
COLUMN CELL
f1:col1 timestamp=1471942737582, value=value01
f1:col2 timestamp=1471942798620, value=value02
2 row(s) in 0.0680 seconds
hbase(main):077:0> get 't1','rowkey001','f1:col1'
COLUMN CELL
f1:col1 timestamp=1471942737582, value=value01
1 row(s) in 0.0040 seconds
hbase(main):078:0> get 't1','rowkey001','f1:col1'
COLUMN CELL
f1:col1 timestamp=1471942737582, value=value01
1 row(s) in 0.0090 seconds
hbase(main):079:0> delete 't1','rowkey001','f1:col1'
0 row(s) in 0.1610 seconds
hbase(main):080:0> get 't1','rowkey001','f1:col1'
COLUMN CELL
0 row(s) in 0.0090 seconds
hbase(main):081:0> get 't1','rowkey001'
COLUMN CELL
f1:col2 timestamp=1471942798620, value=value02
1 row(s) in 0.0380 seconds
hbase(main):082:0> major_compact 't1'
0 row(s) in 12.6920 seconds
hbase(main):083:0> major_compact 't1','col1'
ERROR: java.io.IOException: column family col1 does not exist in region t1,,1471941568616.f8325ccf7d7f120fc89afa35832b65ef.
at org.apache.hadoop.hbase.regionserver.HRegionServer.compactRegion(HRegionServer.java:3889)
at org.apache.hadoop.hbase.protobuf.generated.AdminProtos$AdminService$2.callBlockingMethod(AdminProtos.java:20050)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2008)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:92)
at org.apache.hadoop.hbase.ipc.SimpleRpcScheduler.consumerLoop(SimpleRpcScheduler.java:160)
at org.apache.hadoop.hbase.ipc.SimpleRpcScheduler.access$000(SimpleRpcScheduler.java:38)
at org.apache.hadoop.hbase.ipc.SimpleRpcScheduler$1.run(SimpleRpcScheduler.java:110)
at java.lang.Thread.run(Thread.java:662)
Here is some help for this command:
Run major compaction on passed table or pass a region row
to major compact an individual region. To compact a single
column family within a region specify the region name
followed by the column family name.
Examples:
Compact all regions in a table:
hbase> major_compact 't1'
Compact an entire region:
hbase> major_compact 'r1'
Compact a single column family within a region:
hbase> major_compact 'r1', 'c1'
Compact a single column family within a table:
hbase> major_compact 't1', 'c1'
hbase(main):084:0> major_compact 't1','f1'
0 row(s) in 4.9640 seconds
hbase(main):085:0> describe 't1'
DESCRIPTION ENABLED
't1', {NAME => 'f1', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '0', VERSIONS => '2', COMPR true
ESSION => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY
=> 'false', BLOCKCACHE => 'true'}, {NAME => 'f2', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE
=> '0', VERSIONS => '2', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false', B
LOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
1 row(s) in 0.0650 seconds
hbase(main):086:0> balance_switch
ERROR: wrong number of arguments (0 for 1)
Here is some help for this command:
Enable/Disable balancer. Returns previous balancer state.
Examples:
hbase> balance_switch true
hbase> balance_switch false
hbase(main):087:0> balance_switch true
true
0 row(s) in 0.1240 seconds
hbase(main):088:0> balance_switch false
true
0 row(s) in 0.0140 seconds
hbase(main):089:0> get 't1','rowkey001'
COLUMN CELL
f1:col2 timestamp=1471942798620, value=value02
1 row(s) in 0.0540 seconds
hbase(main):090:0> deleteall 't1','rowkey001'
0 row(s) in 0.0320 seconds
hbase(main):091:0> get 't1','rowkey001'
COLUMN CELL
0 row(s) in 0.0100 seconds
hbase(main):092:0> count't1'
5 row(s) in 0.0220 seconds
=> 5
hbase(main):093:0> list 't*'
TABLE
0 row(s) in 0.5630 seconds
=> []
hbase(main):094:0> create 'member','member_id','address','info'
ERROR: Table already exists: member!
Here is some help for this command:
Creates a table. Pass a table name, and a set of column family
specifications (at least one), and, optionally, table configuration.
Column specification can be a simple string (name), or a dictionary
(dictionaries are described below in main help output), necessarily
including NAME attribute.
Examples:
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}
hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'}
hbase> # The above in shorthand would be the following:
hbase> create 't1', 'f1', 'f2', 'f3'
hbase> create 't1', {NAME => 'f1', VERSIONS => 1, TTL => 2592000, BLOCKCACHE => true}
hbase> create 't1', {NAME => 'f1', CONFIGURATION => {'hbase.hstore.blockingStoreFiles' => '10'}}
Table configuration options can be put at the end.
Examples:
hbase> create 't1', 'f1', SPLITS => ['10', '20', '30', '40']
hbase> create 't1', 'f1', SPLITS_FILE => 'splits.txt', OWNER => 'johndoe'
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}, METADATA => { 'mykey' => 'myvalue' }
hbase> # Optionally pre-split the table into NUMREGIONS, using
hbase> # SPLITALGO ("HexStringSplit", "UniformSplit" or classname)
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit', REGION_REPLICATION => 2, CONFIGURATION => {'hbase.hregion.scan.loadColumnFamiliesOnDemand' => 'true'}}
You can also keep around a reference to the created table:
hbase> t1 = create 't1', 'f1'
Which gives you a reference to the table named 't1', on which you can then
call methods.
hbase(main):095:0> scan 'member'
ROW COLUMN+CELL
0 row(s) in 0.1440 seconds
hbase(main):096:0> count 'member'
0 row(s) in 0.0860 seconds
=> 0
hbase(main):097:0> is_enabled 'member'
true
0 row(s) in 0.1780 seconds
hbase(main):098:0> is_disabled 'member'
false
0 row(s) in 0.1680 seconds
hbase(main):099:0> create 'member','member_id','address','info'
ERROR: Table already exists: member!
Here is some help for this command:
Creates a table. Pass a table name, and a set of column family
specifications (at least one), and, optionally, table configuration.
Column specification can be a simple string (name), or a dictionary
(dictionaries are described below in main help output), necessarily
including NAME attribute.
Examples:
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}
hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'}
hbase> # The above in shorthand would be the following:
hbase> create 't1', 'f1', 'f2', 'f3'
hbase> create 't1', {NAME => 'f1', VERSIONS => 1, TTL => 2592000, BLOCKCACHE => true}
hbase> create 't1', {NAME => 'f1', CONFIGURATION => {'hbase.hstore.blockingStoreFiles' => '10'}}
Table configuration options can be put at the end.
Examples:
hbase> create 't1', 'f1', SPLITS => ['10', '20', '30', '40']
hbase> create 't1', 'f1', SPLITS_FILE => 'splits.txt', OWNER => 'johndoe'
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}, METADATA => { 'mykey' => 'myvalue' }
hbase> # Optionally pre-split the table into NUMREGIONS, using
hbase> # SPLITALGO ("HexStringSplit", "UniformSplit" or classname)
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit', REGION_REPLICATION => 2, CONFIGURATION => {'hbase.hregion.scan.loadColumnFamiliesOnDemand' => 'true'}}
You can also keep around a reference to the created table:
hbase> t1 = create 't1', 'f1'
Which gives you a reference to the table named 't1', on which you can then
call methods.
hbase(main):100:0> drop 'member'
ERROR: Table member is enabled. Disable it first.'
Here is some help for this command:
Drop the named table. Table must first be disabled: e.g. "hbase> drop 't1'"
hbase(main):101:0> create 'member','member_id','address','info'
ERROR: Table already exists: member!
Here is some help for this command:
Creates a table. Pass a table name, and a set of column family
specifications (at least one), and, optionally, table configuration.
Column specification can be a simple string (name), or a dictionary
(dictionaries are described below in main help output), necessarily
including NAME attribute.
Examples:
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}
hbase> create 't1', {NAME => 'f1'}, {NAME => 'f2'}, {NAME => 'f3'}
hbase> # The above in shorthand would be the following:
hbase> create 't1', 'f1', 'f2', 'f3'
hbase> create 't1', {NAME => 'f1', VERSIONS => 1, TTL => 2592000, BLOCKCACHE => true}
hbase> create 't1', {NAME => 'f1', CONFIGURATION => {'hbase.hstore.blockingStoreFiles' => '10'}}
Table configuration options can be put at the end.
Examples:
hbase> create 't1', 'f1', SPLITS => ['10', '20', '30', '40']
hbase> create 't1', 'f1', SPLITS_FILE => 'splits.txt', OWNER => 'johndoe'
hbase> create 't1', {NAME => 'f1', VERSIONS => 5}, METADATA => { 'mykey' => 'myvalue' }
hbase> # Optionally pre-split the table into NUMREGIONS, using
hbase> # SPLITALGO ("HexStringSplit", "UniformSplit" or classname)
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit'}
hbase> create 't1', 'f1', {NUMREGIONS => 15, SPLITALGO => 'HexStringSplit', REGION_REPLICATION => 2, CONFIGURATION => {'hbase.hregion.scan.loadColumnFamiliesOnDemand' => 'true'}}
You can also keep around a reference to the created table:
hbase> t1 = create 't1', 'f1'
Which gives you a reference to the table named 't1', on which you can then
call methods.
hbase(main):102:0> drop 'member'
ERROR: Table member is enabled. Disable it first.'
Here is some help for this command:
Drop the named table. Table must first be disabled: e.g. "hbase> drop 't1'"
hbase(main):103:0> is_disabled 'member'
false
0 row(s) in 0.2080 seconds
hbase(main):104:0> disable 'member'
0 row(s) in 1.5670 seconds
hbase(main):105:0> is_disabled 'member'
true
0 row(s) in 0.1420 seconds
hbase(main):106:0> drop 'member'
0 row(s) in 0.4190 seconds
hbase(main):107:0> create 'member','member_id','address','info'
0 row(s) in 0.8330 seconds
=> Hbase::Table - member
hbase(main):108:0> list 'member'
TABLE
member
1 row(s) in 0.4320 seconds
=> ["member"]
hbase(main):109:0> list 'member.*'
TABLE
member
1 row(s) in 0.5150 seconds
=> ["member"]
hbase(main):110:0> describe 'member'
DESCRIPTION ENABLED
'member', {NAME => 'address', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '0', VERSIONS => ' true
1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536',
IN_MEMORY => 'false', BLOCKCACHE => 'true'}, {NAME => 'info', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICA
TION_SCOPE => '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS =>
'false', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}, {NAME => 'member_id', DATA_BLOCK_ENCODING =>
'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL =
> '2147483647', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
1 row(s) in 0.2790 seconds
hbase(main):111:0>
hbase(main):112:0* alter 'member',{NAME=>'member_id',METHOD=>'delete'}
Updating all regions with the new schema...
1/1 regions updated.
Done.
0 row(s) in 1.9940 seconds
hbase(main):113:0> describe 'member'
DESCRIPTION ENABLED
'member', {NAME => 'address', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '0', VERSIONS => ' true
1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536',
IN_MEMORY => 'false', BLOCKCACHE => 'true'}, {NAME => 'info', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'ROW', REPLICA
TION_SCOPE => '0', VERSIONS => '1', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', KEEP_DELETED_CELLS =>
'false', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
1 row(s) in 0.3320 seconds
hbase(main):114:0> is_disabled 'member'
false
0 row(s) in 0.2770 seconds
hbase(main):115:0> is_enabled 'member'
true
0 row(s) in 0.0630 seconds
hbase(main):116:0> scan 'member'
ROW COLUMN+CELL
0 row(s) in 0.0150 seconds
hbase(main):117:0> exists 'member'
Table member does exist
0 row(s) in 0.1690 seconds
hbase(main):118:0> put'member','scutshuxue','info:age','24'
0 row(s) in 0.0370 seconds
hbase(main):119:0>
hbase(main):120:0* put'member','scutshuxue','info:birthday','1987-06-17'
0 row(s) in 0.0090 seconds
hbase(main):121:0>
hbase(main):122:0* put'member','scutshuxue','info:company','alibaba'
0 row(s) in 0.0030 seconds
hbase(main):123:0>
hbase(main):124:0* put'member','scutshuxue','address:contry','china'
0 row(s) in 0.0040 seconds
hbase(main):125:0>
hbase(main):126:0* put'member','scutshuxue','address:province','zhejiang'
0 row(s) in 0.0160 seconds
hbase(main):127:0>
hbase(main):128:0* put'member','scutshuxue','address:city','hangzhou'
0 row(s) in 0.0170 seconds
hbase(main):129:0> count 'member'
1 row(s) in 0.0510 seconds
=> 1
hbase(main):130:0> scan 'member'
ROW COLUMN+CELL
scutshuxue column=address:city, timestamp=1471948510192, value=hangzhou
scutshuxue column=address:contry, timestamp=1471948508849, value=china
scutshuxue column=address:province, timestamp=1471948508893, value=zhejiang
scutshuxue column=info:age, timestamp=1471948508744, value=24
scutshuxue column=info:birthday, timestamp=1471948508783, value=1987-06-17
scutshuxue column=info:company, timestamp=1471948508821, value=alibaba
1 row(s) in 0.0300 seconds
hbase(main):131:0> put'member','xiaofeng','info:birthday','1987-4-17'
t'member','xiaofeng','address:city','jieyang'
put'member','xiaofeng','address:town','xianqiao'0 row(s) in 0.0400 seconds
hbase(main):132:0>
hbase(main):133:0* put'member','xiaofeng','info:favorite','movie'
0 row(s) in 0.0260 seconds
hbase(main):134:0>
hbase(main):135:0* put'member','xiaofeng','info:company','alibaba'
0 row(s) in 0.0320 seconds
hbase(main):136:0>
hbase(main):137:0* put'member','xiaofeng','address:contry','china'
0 row(s) in 0.0140 seconds
hbase(main):138:0>
hbase(main):139:0* put'member','xiaofeng','address:province','guangdong'
0 row(s) in 0.0130 seconds
hbase(main):140:0>
hbase(main):141:0* put'member','xiaofeng','address:city','jieyang'
0 row(s) in 0.0130 seconds
hbase(main):142:0>
hbase(main):143:0* put'member','xiaofeng','address:town','xianqiao'
0 row(s) in 0.0160 seconds
hbase(main):144:0> scan 'member'
ROW COLUMN+CELL
scutshuxue column=address:city, timestamp=1471948510192, value=hangzhou
scutshuxue column=address:contry, timestamp=1471948508849, value=china
scutshuxue column=address:province, timestamp=1471948508893, value=zhejiang
scutshuxue column=info:age, timestamp=1471948508744, value=24
scutshuxue column=info:birthday, timestamp=1471948508783, value=1987-06-17
scutshuxue column=info:company, timestamp=1471948508821, value=alibaba
xiaofeng column=address:city, timestamp=1471948547875, value=jieyang
xiaofeng column=address:contry, timestamp=1471948547796, value=china
xiaofeng column=address:province, timestamp=1471948547835, value=guangdong
xiaofeng column=address:town, timestamp=1471948548845, value=xianqiao
xiaofeng column=info:birthday, timestamp=1471948547633, value=1987-4-17
xiaofeng column=info:company, timestamp=1471948547755, value=alibaba
xiaofeng column=info:favorite, timestamp=1471948547690, value=movie
2 row(s) in 0.0230 seconds
hbase(main):145:0> count 'member'
2 row(s) in 0.0720 seconds
=> 2
hbase(main):146:0>
hbase(main):147:0* get 'member','scutshuxue'
COLUMN CELL
address:city timestamp=1471948510192, value=hangzhou
address:contry timestamp=1471948508849, value=china
address:province timestamp=1471948508893, value=zhejiang
info:age timestamp=1471948508744, value=24
info:birthday timestamp=1471948508783, value=1987-06-17
info:company timestamp=1471948508821, value=alibaba
6 row(s) in 0.0300 seconds
hbase(main):148:0> get 'member','scutshuxue','info'
COLUMN CELL
info:age timestamp=1471948508744, value=24
info:birthday timestamp=1471948508783, value=1987-06-17
info:company timestamp=1471948508821, value=alibaba
3 row(s) in 0.0170 seconds
hbase(main):149:0> get 'member','scutshuxue','info:age'
COLUMN CELL
info:age timestamp=1471948508744, value=24
1 row(s) in 0.0510 seconds
hbase(main):150:0> put 'member','scutshuxue','info:age' ,'99'
0 row(s) in 0.0070 seconds
hbase(main):151:0> get 'member','scutshuxue','info:age'
COLUMN CELL
info:age timestamp=1471948637784, value=99
1 row(s) in 0.0050 seconds
hbase(main):152:0> get 'member','scutshuxue',{COLUMN=>'info:age',TIMESTAMP=>1321586238965}
COLUMN CELL
0 row(s) in 0.0180 seconds
hbase(main):153:0> get 'member','scutshuxue',{COLUMN=>'info:age',TIMESTAMP=>1471948508744}
COLUMN CELL
info:age timestamp=1471948508744, value=24
1 row(s) in 0.0040 seconds
hbase(main):154:0> get 'member','scutshuxue',{COLUMN=>'info:age',TIMESTAMP=>1471948637784}
COLUMN CELL
info:age timestamp=1471948637784, value=99
1 row(s) in 0.0200 seconds
hbase(main):155:0> scan 'member'
ROW COLUMN+CELL
scutshuxue column=address:city, timestamp=1471948510192, value=hangzhou
scutshuxue column=address:contry, timestamp=1471948508849, value=china
scutshuxue column=address:province, timestamp=1471948508893, value=zhejiang
scutshuxue column=info:age, timestamp=1471948637784, value=99
scutshuxue column=info:birthday, timestamp=1471948508783, value=1987-06-17
scutshuxue column=info:company, timestamp=1471948508821, value=alibaba
xiaofeng column=address:city, timestamp=1471948547875, value=jieyang
xiaofeng column=address:contry, timestamp=1471948547796, value=china
xiaofeng column=address:province, timestamp=1471948547835, value=guangdong
xiaofeng column=address:town, timestamp=1471948548845, value=xianqiao
xiaofeng column=info:birthday, timestamp=1471948547633, value=1987-4-17
xiaofeng column=info:company, timestamp=1471948547755, value=alibaba
xiaofeng column=info:favorite, timestamp=1471948547690, value=movie
2 row(s) in 0.0170 seconds
hbase(main):156:0> delete 'member','temp','info:age'
ERROR: Row Not Found
Here is some help for this command:
Put a delete cell value at specified table/row/column and optionally
timestamp coordinates. Deletes must match the deleted cell's
coordinates exactly. When scanning, a delete cell suppresses older
versions. To delete a cell from 't1' at row 'r1' under column 'c1'
marked with the time 'ts1', do:
hbase> delete 't1', 'r1', 'c1', ts1
The same command can also be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.delete 'r1', 'c1', ts1
hbase(main):157:0> scan 'member'
ROW COLUMN+CELL
scutshuxue column=address:city, timestamp=1471948510192, value=hangzhou
scutshuxue column=address:contry, timestamp=1471948508849, value=china
scutshuxue column=address:province, timestamp=1471948508893, value=zhejiang
scutshuxue column=info:age, timestamp=1471948637784, value=99
scutshuxue column=info:birthday, timestamp=1471948508783, value=1987-06-17
scutshuxue column=info:company, timestamp=1471948508821, value=alibaba
xiaofeng column=address:city, timestamp=1471948547875, value=jieyang
xiaofeng column=address:contry, timestamp=1471948547796, value=china
xiaofeng column=address:province, timestamp=1471948547835, value=guangdong
xiaofeng column=address:town, timestamp=1471948548845, value=xianqiao
xiaofeng column=info:birthday, timestamp=1471948547633, value=1987-4-17
xiaofeng column=info:company, timestamp=1471948547755, value=alibaba
xiaofeng column=info:favorite, timestamp=1471948547690, value=movie
2 row(s) in 0.0180 seconds
hbase(main):158:0> scan 'member'
ROW COLUMN+CELL
scutshuxue column=address:city, timestamp=1471948510192, value=hangzhou
scutshuxue column=address:contry, timestamp=1471948508849, value=china
scutshuxue column=address:province, timestamp=1471948508893, value=zhejiang
scutshuxue column=info:age, timestamp=1471948637784, value=99
scutshuxue column=info:birthday, timestamp=1471948508783, value=1987-06-17
scutshuxue column=info:company, timestamp=1471948508821, value=alibaba
xiaofeng column=address:city, timestamp=1471948547875, value=jieyang
xiaofeng column=address:contry, timestamp=1471948547796, value=china
xiaofeng column=address:province, timestamp=1471948547835, value=guangdong
xiaofeng column=address:town, timestamp=1471948548845, value=xianqiao
xiaofeng column=info:birthday, timestamp=1471948547633, value=1987-4-17
xiaofeng column=info:company, timestamp=1471948547755, value=alibaba
xiaofeng column=info:favorite, timestamp=1471948547690, value=movie
2 row(s) in 0.0190 seconds
hbase(main):159:0> put'member','temp','info:birthday','1987-4-17'
0 row(s) in 0.0080 seconds
hbase(main):160:0>
hbase(main):161:0* put'member','temp','info:favorite','movie'
0 row(s) in 0.0040 seconds
hbase(main):162:0>
hbase(main):163:0* put'member','temp','info:company','alibaba'
0 row(s) in 0.0030 seconds
hbase(main):164:0>
hbase(main):165:0* put'member','temp','address:contry','china'
0 row(s) in 0.0040 seconds
hbase(main):166:0>
hbase(main):167:0* put'member','temp','address:province','guangdong'
0 row(s) in 0.0030 seconds
hbase(main):168:0>
hbase(main):169:0* put'member','temp','address:city','jieyang'
0 row(s) in 0.0030 seconds
hbase(main):170:0>
hbase(main):171:0* put'member','temp','address:town','xianqiao'
0 row(s) in 0.0070 seconds
hbase(main):172:0> scan 'member'
ROW COLUMN+CELL
scutshuxue column=address:city, timestamp=1471948510192, value=hangzhou
scutshuxue column=address:contry, timestamp=1471948508849, value=china
scutshuxue column=address:province, timestamp=1471948508893, value=zhejiang
scutshuxue column=info:age, timestamp=1471948637784, value=99
scutshuxue column=info:birthday, timestamp=1471948508783, value=1987-06-17
scutshuxue column=info:company, timestamp=1471948508821, value=alibaba
temp column=address:city, timestamp=1471949020999, value=jieyang
temp column=address:contry, timestamp=1471949020948, value=china
temp column=address:province, timestamp=1471949020975, value=guangdong
temp column=address:town, timestamp=1471949021892, value=xianqiao
temp column=info:birthday, timestamp=1471949020868, value=1987-4-17
temp column=info:company, timestamp=1471949020923, value=alibaba
temp column=info:favorite, timestamp=1471949020897, value=movie
xiaofeng column=address:city, timestamp=1471948547875, value=jieyang
xiaofeng column=address:contry, timestamp=1471948547796, value=china
xiaofeng column=address:province, timestamp=1471948547835, value=guangdong
xiaofeng column=address:town, timestamp=1471948548845, value=xianqiao
xiaofeng column=info:birthday, timestamp=1471948547633, value=1987-4-17
xiaofeng column=info:company, timestamp=1471948547755, value=alibaba
xiaofeng column=info:favorite, timestamp=1471948547690, value=movie
3 row(s) in 0.0190 seconds
hbase(main):173:0> get 'member','temp','info:age'
COLUMN CELL
0 row(s) in 0.0030 seconds
hbase(main):174:0> put'member','temp','info:age','27'
0 row(s) in 0.0110 seconds
hbase(main):175:0> get 'member','temp','info:age'
COLUMN CELL
info:age timestamp=1471949097561, value=27
1 row(s) in 0.0070 seconds
hbase(main):176:0> scan 'member'
ROW COLUMN+CELL
scutshuxue column=address:city, timestamp=1471948510192, value=hangzhou
scutshuxue column=address:contry, timestamp=1471948508849, value=china
scutshuxue column=address:province, timestamp=1471948508893, value=zhejiang
scutshuxue column=info:age, timestamp=1471948637784, value=99
scutshuxue column=info:birthday, timestamp=1471948508783, value=1987-06-17
scutshuxue column=info:company, timestamp=1471948508821, value=alibaba
temp column=address:city, timestamp=1471949020999, value=jieyang
temp column=address:contry, timestamp=1471949020948, value=china
temp column=address:province, timestamp=1471949020975, value=guangdong
temp column=address:town, timestamp=1471949021892, value=xianqiao
temp column=info:age, timestamp=1471949097561, value=27
temp column=info:birthday, timestamp=1471949020868, value=1987-4-17
temp column=info:company, timestamp=1471949020923, value=alibaba
temp column=info:favorite, timestamp=1471949020897, value=movie
xiaofeng column=address:city, timestamp=1471948547875, value=jieyang
xiaofeng column=address:contry, timestamp=1471948547796, value=china
xiaofeng column=address:province, timestamp=1471948547835, value=guangdong
xiaofeng column=address:town, timestamp=1471948548845, value=xianqiao
xiaofeng column=info:birthday, timestamp=1471948547633, value=1987-4-17
xiaofeng column=info:company, timestamp=1471948547755, value=alibaba
xiaofeng column=info:favorite, timestamp=1471948547690, value=movie
3 row(s) in 0.0200 seconds
hbase(main):177:0> get 'member','temp','info:age'
COLUMN CELL
info:age timestamp=1471949097561, value=27
1 row(s) in 0.0130 seconds
hbase(main):178:0> delete 'member','temp','info:age'
0 row(s) in 0.0170 seconds
hbase(main):179:0> get 'member','temp','info:age'
COLUMN CELL
0 row(s) in 0.0040 seconds
hbase(main):180:0> get 'member','temp'
COLUMN CELL
address:city timestamp=1471949020999, value=jieyang
address:contry timestamp=1471949020948, value=china
address:province timestamp=1471949020975, value=guangdong
address:town timestamp=1471949021892, value=xianqiao
info:birthday timestamp=1471949020868, value=1987-4-17
info:company timestamp=1471949020923, value=alibaba
info:favorite timestamp=1471949020897, value=movie
7 row(s) in 0.0080 seconds
hbase(main):181:0> deleteall 'member','temp'
0 row(s) in 0.0160 seconds
hbase(main):182:0> get 'member','temp'
COLUMN CELL
0 row(s) in 0.0020 seconds
hbase(main):183:0> count 'member'
2 row(s) in 0.0070 seconds
=> 2
hbase(main):184:0> get 'member','xiaofeng','info:age'
COLUMN CELL
0 row(s) in 0.0060 seconds
hbase(main):185:0> scan 'member'
ROW COLUMN+CELL
scutshuxue column=address:city, timestamp=1471948510192, value=hangzhou
scutshuxue column=address:contry, timestamp=1471948508849, value=china
scutshuxue column=address:province, timestamp=1471948508893, value=zhejiang
scutshuxue column=info:age, timestamp=1471948637784, value=99
scutshuxue column=info:birthday, timestamp=1471948508783, value=1987-06-17
scutshuxue column=info:company, timestamp=1471948508821, value=alibaba
xiaofeng column=address:city, timestamp=1471948547875, value=jieyang
xiaofeng column=address:contry, timestamp=1471948547796, value=china
xiaofeng column=address:province, timestamp=1471948547835, value=guangdong
xiaofeng column=address:town, timestamp=1471948548845, value=xianqiao
xiaofeng column=info:birthday, timestamp=1471948547633, value=1987-4-17
xiaofeng column=info:company, timestamp=1471948547755, value=alibaba
xiaofeng column=info:favorite, timestamp=1471948547690, value=movie
2 row(s) in 0.0180 seconds
hbase(main):186:0> get 'member','scutshuxue','info:age'
COLUMN CELL
info:age timestamp=1471948637784, value=99
1 row(s) in 0.0040 seconds
hbase(main):187:0> incr 'member','scutshuxue','info:age'
ERROR: org.apache.hadoop.hbase.DoNotRetryIOException: Attempted to increment field that isn't 64 bits wide
at org.apache.hadoop.hbase.regionserver.HRegion.increment(HRegion.java:5271)
at org.apache.hadoop.hbase.regionserver.HRegionServer.increment(HRegionServer.java:4154)
at org.apache.hadoop.hbase.regionserver.HRegionServer.mutate(HRegionServer.java:2912)
at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:28859)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2008)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:92)
at org.apache.hadoop.hbase.ipc.SimpleRpcScheduler.consumerLoop(SimpleRpcScheduler.java:160)
at org.apache.hadoop.hbase.ipc.SimpleRpcScheduler.access$000(SimpleRpcScheduler.java:38)
at org.apache.hadoop.hbase.ipc.SimpleRpcScheduler$1.run(SimpleRpcScheduler.java:110)
at java.lang.Thread.run(Thread.java:662)
Here is some help for this command:
Increments a cell 'value' at specified table/row/column coordinates.
To increment a cell value in table 't1' at row 'r1' under column
'c1' by 1 (can be omitted) or 10 do:
hbase> incr 't1', 'r1', 'c1'
hbase> incr 't1', 'r1', 'c1', 1
hbase> incr 't1', 'r1', 'c1', 10
hbase> incr 't1', 'r1', 'c1', 10, {ATTRIBUTES=>{'mykey'=>'myvalue'}}
hbase> incr 't1', 'r1', 'c1', {ATTRIBUTES=>{'mykey'=>'myvalue'}}
hbase> incr 't1', 'r1', 'c1', 10, {VISIBILITY=>'PRIVATE|SECRET'}
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.incr 'r1', 'c1'
hbase> t.incr 'r1', 'c1', 1
hbase> t.incr 'r1', 'c1', 10, {ATTRIBUTES=>{'mykey'=>'myvalue'}}
hbase> t.incr 'r1', 'c1', 10, {VISIBILITY=>'PRIVATE|SECRET'}
hbase(main):188:0> get 'member','scutshuxue','info:age'
COLUMN CELL
info:age timestamp=1471948637784, value=99
1 row(s) in 0.0130 seconds
hbase(main):189:0> get 'member','scutshuxue','info'
COLUMN CELL
info:age timestamp=1471948637784, value=99
info:birthday timestamp=1471948508783, value=1987-06-17
info:company timestamp=1471948508821, value=alibaba
3 row(s) in 0.0050 seconds
hbase(main):190:0> incr 'member','scutshuxue','info:age1'
0 row(s) in 0.0070 seconds
hbase(main):191:0> get 'member','scutshuxue','info'
COLUMN CELL
info:age timestamp=1471948637784, value=99
info:age1 timestamp=1471949481248, value=\x00\x00\x00\x00\x00\x00\x00\x01
info:birthday timestamp=1471948508783, value=1987-06-17
info:company timestamp=1471948508821, value=alibaba
4 row(s) in 0.0100 seconds
hbase(main):192:0> get 'member','scutshuxue','info:age1'
COLUMN CELL
info:age1 timestamp=1471949481248, value=\x00\x00\x00\x00\x00\x00\x00\x01
1 row(s) in 0.0040 seconds
hbase(main):193:0> incr 'member','scutshuxue','info:age1'
0 row(s) in 0.0070 seconds
hbase(main):194:0> get 'member','scutshuxue','info:age1'
COLUMN CELL
info:age1 timestamp=1471949530189, value=\x00\x00\x00\x00\x00\x00\x00\x02
1 row(s) in 0.0070 seconds
hbase(main):195:0> incr 'member','scutshuxue','info:age1'
0 row(s) in 0.0040 seconds
hbase(main):196:0> get 'member','scutshuxue','info:age1'
COLUMN CELL
info:age1 timestamp=1471949539893, value=\x00\x00\x00\x00\x00\x00\x00\x03
1 row(s) in 0.0080 seconds
hbase(main):197:0> get 'member','scutshuxue','info:age'
COLUMN CELL
info:age timestamp=1471948637784, value=99
1 row(s) in 0.0030 seconds
hbase(main):198:0> incr 'member','scutshuxue','info:age'
ERROR: org.apache.hadoop.hbase.DoNotRetryIOException: Attempted to increment field that isn't 64 bits wide
at org.apache.hadoop.hbase.regionserver.HRegion.increment(HRegion.java:5271)
at org.apache.hadoop.hbase.regionserver.HRegionServer.increment(HRegionServer.java:4154)
at org.apache.hadoop.hbase.regionserver.HRegionServer.mutate(HRegionServer.java:2912)
at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:28859)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2008)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:92)
at org.apache.hadoop.hbase.ipc.SimpleRpcScheduler.consumerLoop(SimpleRpcScheduler.java:160)
at org.apache.hadoop.hbase.ipc.SimpleRpcScheduler.access$000(SimpleRpcScheduler.java:38)
at org.apache.hadoop.hbase.ipc.SimpleRpcScheduler$1.run(SimpleRpcScheduler.java:110)
at java.lang.Thread.run(Thread.java:662)
Here is some help for this command:
Increments a cell 'value' at specified table/row/column coordinates.
To increment a cell value in table 't1' at row 'r1' under column
'c1' by 1 (can be omitted) or 10 do:
hbase> incr 't1', 'r1', 'c1'
hbase> incr 't1', 'r1', 'c1', 1
hbase> incr 't1', 'r1', 'c1', 10
hbase> incr 't1', 'r1', 'c1', 10, {ATTRIBUTES=>{'mykey'=>'myvalue'}}
hbase> incr 't1', 'r1', 'c1', {ATTRIBUTES=>{'mykey'=>'myvalue'}}
hbase> incr 't1', 'r1', 'c1', 10, {VISIBILITY=>'PRIVATE|SECRET'}
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.incr 'r1', 'c1'
hbase> t.incr 'r1', 'c1', 1
hbase> t.incr 'r1', 'c1', 10, {ATTRIBUTES=>{'mykey'=>'myvalue'}}
hbase> t.incr 'r1', 'c1', 10, {VISIBILITY=>'PRIVATE|SECRET'}
hbase(main):199:0> get 'member','scutshuxue','info'
COLUMN CELL
info:age timestamp=1471948637784, value=99
info:age1 timestamp=1471949539893, value=\x00\x00\x00\x00\x00\x00\x00\x03
info:birthday timestamp=1471948508783, value=1987-06-17
info:company timestamp=1471948508821, value=alibaba
4 row(s) in 0.0070 seconds
hbase(main):200:0> get_counter 'member','scutshuxue','info:age'
ERROR: wrong number of arguments (3 for 4)
Here is some help for this command:
Return a counter cell value at specified table/row/column coordinates.
A cell cell should be managed with atomic increment function oh HBase
and the data should be binary encoded. Example:
hbase> get_counter 't1', 'r1', 'c1'
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.get_counter 'r1', 'c1'
hbase(main):201:0> get_counter 'member','scutshuxue','info:age'
ERROR: wrong number of arguments (3 for 4)
Here is some help for this command:
Return a counter cell value at specified table/row/column coordinates.
A cell cell should be managed with atomic increment function oh HBase
and the data should be binary encoded. Example:
hbase> get_counter 't1', 'r1', 'c1'
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.get_counter 'r1', 'c1'
hbase(main):202:0> get_counter 'member','scutshuxue','info:age1'
ERROR: wrong number of arguments (3 for 4)
Here is some help for this command:
Return a counter cell value at specified table/row/column coordinates.
A cell cell should be managed with atomic increment function oh HBase
and the data should be binary encoded. Example:
hbase> get_counter 't1', 'r1', 'c1'
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.get_counter 'r1', 'c1'
hbase(main):203:0> 'member'.get_counter 'scutshuxue','info:age1'
NoMethodError: undefined method `get_counter' for "member":String
hbase(main):204:0> get_counter 'member','scutshuxue','info:age1'
ERROR: wrong number of arguments (3 for 4)
Here is some help for this command:
Return a counter cell value at specified table/row/column coordinates.
A cell cell should be managed with atomic increment function oh HBase
and the data should be binary encoded. Example:
hbase> get_counter 't1', 'r1', 'c1'
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.get_counter 'r1', 'c1'
hbase(main):205:0> get_counter 'member','scutshuxue','info:age'
ERROR: wrong number of arguments (3 for 4)
Here is some help for this command:
Return a counter cell value at specified table/row/column coordinates.
A cell cell should be managed with atomic increment function oh HBase
and the data should be binary encoded. Example:
hbase> get_counter 't1', 'r1', 'c1'
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.get_counter 'r1', 'c1'
hbase(main):206:0> get_counter 'member','scutshuxue','info:age1'
ERROR: wrong number of arguments (3 for 4)
Here is some help for this command:
Return a counter cell value at specified table/row/column coordinates.
A cell cell should be managed with atomic increment function oh HBase
and the data should be binary encoded. Example:
hbase> get_counter 't1', 'r1', 'c1'
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.get_counter 'r1', 'c1'
hbase(main):207:0> get 'member','scutshuxue','info:age1'
COLUMN CELL
info:age1 timestamp=1471949539893, value=\x00\x00\x00\x00\x00\x00\x00\x03
1 row(s) in 0.0120 seconds
hbase(main):208:0> get 'member','scutshuxue','info:age'
COLUMN CELL
info:age timestamp=1471948637784, value=99
1 row(s) in 0.0730 seconds
hbase(main):209:0> get_counter 'member','scutshuxue','info:age'
ERROR: wrong number of arguments (3 for 4)
Here is some help for this command:
Return a counter cell value at specified table/row/column coordinates.
A cell cell should be managed with atomic increment function oh HBase
and the data should be binary encoded. Example:
hbase> get_counter 't1', 'r1', 'c1'
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.get_counter 'r1', 'c1'
hbase(main):210:0> get_counter 'member','scutshuxue','info:age1'
ERROR: wrong number of arguments (3 for 4)
Here is some help for this command:
Return a counter cell value at specified table/row/column coordinates.
A cell cell should be managed with atomic increment function oh HBase
and the data should be binary encoded. Example:
hbase> get_counter 't1', 'r1', 'c1'
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.get_counter 'r1', 'c1'
hbase(main):211:0> get 'member','scutshuxue','info'
COLUMN CELL
info:age timestamp=1471948637784, value=99
info:age1 timestamp=1471949539893, value=\x00\x00\x00\x00\x00\x00\x00\x03
info:birthday timestamp=1471948508783, value=1987-06-17
info:company timestamp=1471948508821, value=alibaba
4 row(s) in 0.0660 seconds
hbase(main):212:0> get_counter 'member','scutshuxue','info'
ERROR: wrong number of arguments (3 for 4)
Here is some help for this command:
Return a counter cell value at specified table/row/column coordinates.
A cell cell should be managed with atomic increment function oh HBase
and the data should be binary encoded. Example:
hbase> get_counter 't1', 'r1', 'c1'
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.get_counter 'r1', 'c1'
hbase(main):213:0> get_counter 'member','scutshuxue','info:age1'
ERROR: wrong number of arguments (3 for 4)
Here is some help for this command:
Return a counter cell value at specified table/row/column coordinates.
A cell cell should be managed with atomic increment function oh HBase
and the data should be binary encoded. Example:
hbase> get_counter 't1', 'r1', 'c1'
The same commands also can be run on a table reference. Suppose you had a reference
t to table 't1', the corresponding command would be:
hbase> t.get_counter 'r1', 'c1'
hbase(main):214:0> get 'member','scutshuxue','info:age1'
COLUMN CELL
info:age1 timestamp=1471949539893, value=\x00\x00\x00\x00\x00\x00\x00\x03
1 row(s) in 0.0340 seconds
hbase(main):215:0>
hbase_1 [get_counter 报错]_good
最新推荐文章于 2023-12-08 20:39:50 发布