Database Reference
In-Depth Information
Figure 7.5
Getting the row cell values.
You can also use the
get
command to retrieve the previous versions of a cell
value. The following
get
command gets the last three versions of the high
column.
Figure 7.6
shows the output:
get 'Stocks', 'ABXA_12092009', {COLUMN =>
'Price:High', VERSIONS => 3}
Figure 7.6
Retrieving previous versions of a cell.
You can query the values in the HBase table using the
scan
command. The
following command returns all columns in the Stocks table:
scan 'Stocks'
You can limit the output by passing filters with the
scan
command. For
example, to retrieve just the high price column, you can use the following
command:
scan 'Stocks', {COLUMNS => ['Price:High']}
You can also use value-based filters, prefix filters, and timestamp filters. For
example, this filter scans for values greater than 2.8:
scan 'Stocks', {FILTER => "ValueFilter(>,
'binary:2.8')"}
HBaseprovidesforfastscanningandletsyoucreatesomecomplexquerying
through the use of filters. Unfortunately, it is based on the JRuby language