HBASE-852 Cannot scan all families in a row with a LIMIT, STARTROW, etc.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@703025 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-10-08 23:45:30 +00:00
parent 0a3560ccea
commit 252e017903
3 changed files with 28 additions and 26 deletions

View File

@ -5,6 +5,8 @@ Release 0.19.0 - Unreleased
(Doğacan Güney via Stack)
HBASE-905 Remove V5 migration classes from 0.19.0 (Jean-Daniel Cryans via
Jim Kellerman)
HBASE-852 Cannot scan all families in a row with a LIMIT, STARTROW, etc.
(Izaak Rubin via Stack)
BUG FIXES
HBASE-891 HRS.validateValuesLength throws IOE, gets caught in the retries

View File

@ -223,33 +223,33 @@ module HBase
result
end
def scan(columns, args = {})
def scan(args = {})
now = Time.now
if not columns or columns.length < 1
# Make up list of columns.
columns = getAllColumns()
end
if columns.class == String
columns = [columns]
elsif columns.class != Array
raise ArgumentError.new("Must supply columns")
end
cs = columns.to_java(java.lang.String)
limit = -1
if args == nil or args.length <= 0
s = @table.getScanner(cs)
else
if args != nil and args.length > 0
limit = args["LIMIT"] || -1
filter = args["FILTER"] || nil
startrow = args["STARTROW"] || ""
stoprow = args["STOPROW"] || nil
timestamp = args["TIMESTAMP"] || HConstants::LATEST_TIMESTAMP
columns = args["COLUMNS"] || getAllColumns()
if columns.class == String
columns = [columns]
elsif columns.class != Array
raise ArgumentError.new("COLUMNS must be specified as a String or an Array")
end
cs = columns.to_java(java.lang.String)
if stoprow
s = @table.getScanner(cs, startrow, stoprow, timestamp)
else
s = @table.getScanner(cs, startrow, timestamp, filter)
end
end
else
columns = getAllColumns()
s = @table.getScanner(columns.to_java(java.lang.String))
end
count = 0
@formatter.header(["ROW", "COLUMN+CELL"])
i = s.iterator()

View File

@ -175,17 +175,17 @@ HBASE SHELL COMMANDS:
hbase> put 't1', 'r1', 'c1', 'value', ts1
scan Scan a table; pass table name and optionally an array of column
names OR an array of column names AND a dictionary of scanner
specifications. If you wish to include scanner specifications,
you must also include an array of columns. Scanner specifications
may include one or more of the following: LIMIT, STARTROW, STOPROW,
or TIMESTAMP. To scan all members of a column family, leave the
qualifier empty as in 'col_family:'. Examples:
scan Scan a table; pass table name and optionally a dictionary of scanner
specifications. Scanner specifications may include one or more of
the following: LIMIT, STARTROW, STOPROW, TIMESTAMP, or COLUMNS. If
no columns are specified, all columns will be scanned. To scan all
members of a column family, leave the qualifier empty as in
'col_family:'. Examples:
hbase> scan '.META.'
hbase> scan '.META.', ['info:regioninfo']
hbase> scan 't1', ['c1', 'c2'], {LIMIT => 10, STARTROW => 'xyz'}
hbase> scan '.META.', {COLUMNS => 'info:regioninfo'}
hbase> scan 't1', {COLUMNS => ['c1', 'c2'], LIMIT => 10, \\
STARTROW => 'xyz'}
version Output this HBase version
@ -271,8 +271,8 @@ def put(table, row, column, value, timestamp = nil)
table(table).put(row, column, value, timestamp)
end
def scan(table, columns = [], args = {})
table(table).scan(columns, args)
def scan(table, args = {})
table(table).scan(args)
end
def delete(table, row, column,