Index: src/main/ruby/hbase/table.rb =================================================================== --- src/main/ruby/hbase/table.rb (revision 1212005) +++ src/main/ruby/hbase/table.rb (working copy) @@ -218,10 +218,11 @@ startrow = args["STARTROW"] || '' stoprow = args["STOPROW"] timestamp = args["TIMESTAMP"] - columns = args["COLUMNS"] || args["COLUMN"] || get_all_columns + columns = args["COLUMNS"] || args["COLUMN"] || [] cache = args["CACHE_BLOCKS"] || true versions = args["VERSIONS"] || 1 timerange = args[TIMERANGE] + raw = args["RAW"] || false # Normalize column names columns = [columns] if columns.class == String @@ -254,6 +255,7 @@ scan.setCacheBlocks(cache) scan.setMaxVersions(versions) if versions > 1 scan.setTimeRange(timerange[0], timerange[1]) if timerange + scan.setRaw(raw) else scan = org.apache.hadoop.hbase.client.Scan.new end @@ -335,7 +337,11 @@ end end - val = "timestamp=#{kv.getTimestamp}, value=#{org.apache.hadoop.hbase.util.Bytes::toStringBinary(kv.getValue)}" + if kv.isDelete + val = "timestamp=#{kv.getTimestamp}, type=#{org.apache.hadoop.hbase.KeyValue::Type::codeToType(kv.getType)}" + else + val = "timestamp=#{kv.getTimestamp}, value=#{org.apache.hadoop.hbase.util.Bytes::toStringBinary(kv.getValue)}" + end (maxlength != -1) ? val[0, maxlength] : val end Index: src/main/ruby/hbase.rb =================================================================== --- src/main/ruby/hbase.rb (revision 1212005) +++ src/main/ruby/hbase.rb (working copy) @@ -43,6 +43,7 @@ STOPROW = "STOPROW" STARTROW = "STARTROW" ENDROW = STOPROW + RAW = "RAW" LIMIT = "LIMIT" METHOD = "METHOD" MAXLENGTH = "MAXLENGTH" Index: src/main/ruby/shell/commands/scan.rb =================================================================== --- src/main/ruby/shell/commands/scan.rb (revision 1212005) +++ src/main/ruby/shell/commands/scan.rb (working copy) @@ -51,6 +51,11 @@ 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) + + hbase> scan 't1', {RAW => true, VERSIONS => 10} EOF end