HBASE-19178 table.rb use undefined method 'getType' for Cell interface
This commit is contained in:
parent
b464c1eb35
commit
1a93fe89cd
|
@ -749,7 +749,7 @@ EOF
|
||||||
end
|
end
|
||||||
|
|
||||||
if org.apache.hadoop.hbase.CellUtil.isDelete(kv)
|
if org.apache.hadoop.hbase.CellUtil.isDelete(kv)
|
||||||
val = "timestamp=#{kv.getTimestamp}, type=#{org.apache.hadoop.hbase.KeyValue::Type.codeToType(kv.getType)}"
|
val = "timestamp=#{kv.getTimestamp}, type=#{org.apache.hadoop.hbase.KeyValue::Type.codeToType(kv.getTypeByte)}"
|
||||||
else
|
else
|
||||||
val = "timestamp=#{kv.getTimestamp}, value=#{convert(column, kv, converter_class, converter)}"
|
val = "timestamp=#{kv.getTimestamp}, value=#{convert(column, kv, converter_class, converter)}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -557,22 +557,41 @@ module Hbase
|
||||||
@test_table.put(2, "x:raw1", 11)
|
@test_table.put(2, "x:raw1", 11)
|
||||||
|
|
||||||
args = {}
|
args = {}
|
||||||
numRows = 0
|
num_rows = 0
|
||||||
count = @test_table._scan_internal(args) do |row, cells| # Normal Scan
|
@test_table._scan_internal(args) do # Normal Scan
|
||||||
numRows += 1
|
num_rows += 1
|
||||||
end
|
end
|
||||||
assert_equal(numRows, 2, "Num rows scanned without RAW/VERSIONS are not 2")
|
assert_equal(num_rows, 2,
|
||||||
|
'Num rows scanned without RAW/VERSIONS are not 2')
|
||||||
|
|
||||||
args = {VERSIONS=>10,RAW=>true} # Since 4 versions of row with rowkey 2 is been added, we can use any number >= 4 for VERSIONS to scan all 4 versions.
|
args = { VERSIONS => 10, RAW => true } # Since 4 versions of row with rowkey 2 is been added, we can use any number >= 4 for VERSIONS to scan all 4 versions.
|
||||||
numRows = 0
|
num_rows = 0
|
||||||
count = @test_table._scan_internal(args) do |row, cells| # Raw Scan
|
@test_table._scan_internal(args) do # Raw Scan
|
||||||
numRows += 1
|
num_rows += 1
|
||||||
end
|
end
|
||||||
assert_equal(numRows, 5, "Num rows scanned without RAW/VERSIONS are not 5") # 5 since , 1 from row key '1' and other 4 from row key '4'
|
# 5 since , 1 from row key '1' and other 4 from row key '4'
|
||||||
|
assert_equal(num_rows, 5,
|
||||||
|
'Num rows scanned without RAW/VERSIONS are not 5')
|
||||||
|
|
||||||
|
@test_table.delete(1, 'x:a')
|
||||||
|
args = {}
|
||||||
|
num_rows = 0
|
||||||
|
@test_table._scan_internal(args) do # Normal Scan
|
||||||
|
num_rows += 1
|
||||||
|
end
|
||||||
|
assert_equal(num_rows, 1,
|
||||||
|
'Num rows scanned without RAW/VERSIONS are not 1')
|
||||||
|
|
||||||
|
args = { VERSIONS => 10, RAW => true }
|
||||||
|
num_rows = 0
|
||||||
|
@test_table._scan_internal(args) do # Raw Scan
|
||||||
|
num_rows += 1
|
||||||
|
end
|
||||||
|
# 6 since , 2 from row key '1' and other 4 from row key '4'
|
||||||
|
assert_equal(num_rows, 6,
|
||||||
|
'Num rows scanned without RAW/VERSIONS are not 5')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
define_test "scan should fail on invalid COLUMNS parameter types" do
|
define_test "scan should fail on invalid COLUMNS parameter types" do
|
||||||
assert_raise(ArgumentError) do
|
assert_raise(ArgumentError) do
|
||||||
@test_table._scan_internal COLUMNS => {}
|
@test_table._scan_internal COLUMNS => {}
|
||||||
|
|
Loading…
Reference in New Issue