Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 02-25-2019 04:05 PM
I can select a particular version from a table , but how can I select a range of versions ? e.g say I want to select all the rows from timestamp 1551108073557 to 1551108018724 ?
hbase(main):005:0> scan 'PERSON',{NAME => 'student',VERSIONS => 5}
ROW COLUMN+CELL
r1 column=student:student_name, timestamp=1551108086986, value=John
r1 column=student:student_name, timestamp=1551108073557, value=Mary
r1 column=student:student_name, timestamp=1551108037609, value=Nancy
r1 column=student:student_name, timestamp=1551108018724, value=Ram
r1 column=student:student_name, timestamp=1551108002231, value=Sam
1 row(s) in 0.0190 seconds
hbase(main):006:0>
hbase(main):007:0*
hbase(main):008:0* get 'PERSON','r1',{COLUMN => 'student', TIMESTAMP => 1551108018724}
COLUMN CELL
student:student_name timestamp=1551108018724, value=Ram
Created 02-25-2019 04:47 PM
hbase(main):001:0> help 'scan'
Scan a table; pass table name and optionally a dictionary of scanner
specifications. Scanner specifications may include one or more of:
TIMERANGE, FILTER, LIMIT, STARTROW, STOPROW, ROWPREFIXFILTER, TIMESTAMP,
MAXLENGTH or COLUMNS, CACHE or RAW, VERSIONS, ALL_METRICS or METRICS
...
Some examples:
...
hbase> scan 't1', {COLUMNS => 'c1', TIMERANGE => [1303668804000, 1303668904000]}
Created 02-25-2019 04:47 PM
hbase(main):001:0> help 'scan'
Scan a table; pass table name and optionally a dictionary of scanner
specifications. Scanner specifications may include one or more of:
TIMERANGE, FILTER, LIMIT, STARTROW, STOPROW, ROWPREFIXFILTER, TIMESTAMP,
MAXLENGTH or COLUMNS, CACHE or RAW, VERSIONS, ALL_METRICS or METRICS
...
Some examples:
...
hbase> scan 't1', {COLUMNS => 'c1', TIMERANGE => [1303668804000, 1303668904000]}
Created 02-25-2019 04:52 PM
hi Josh how can I do it via 'get' command ? since we will be using java to get these rows
Created 02-25-2019 05:01 PM
Created 02-25-2019 05:05 PM
and can "scan" command be called from a java code ?