HBASE-26895 on hbase shell, 'delete/deleteall' for a columnfamily is not working (#4283)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit ea9bc92ce2
)
This commit is contained in:
parent
52ca440ad6
commit
5dc93d7b8c
|
@ -189,10 +189,18 @@ EOF
|
||||||
if column != ""
|
if column != ""
|
||||||
if column && all_version
|
if column && all_version
|
||||||
family, qualifier = parse_column_name(column)
|
family, qualifier = parse_column_name(column)
|
||||||
d.addColumns(family, qualifier, timestamp)
|
if qualifier
|
||||||
|
d.addColumns(family, qualifier, timestamp)
|
||||||
|
else
|
||||||
|
d.addFamily(family, timestamp)
|
||||||
|
end
|
||||||
elsif column && !all_version
|
elsif column && !all_version
|
||||||
family, qualifier = parse_column_name(column)
|
family, qualifier = parse_column_name(column)
|
||||||
d.addColumn(family, qualifier, timestamp)
|
if qualifier
|
||||||
|
d.addColumn(family, qualifier, timestamp)
|
||||||
|
else
|
||||||
|
d.addFamilyVersion(family, timestamp)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
d
|
d
|
||||||
|
|
|
@ -164,6 +164,21 @@ module Hbase
|
||||||
assert_nil(res)
|
assert_nil(res)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
define_test "delete should set proper cell type" do
|
||||||
|
del = @test_table._createdelete_internal('104', 'x:a', 1212)
|
||||||
|
assert_equal(del.get('x'.to_java_bytes, 'a'.to_java_bytes).get(0).getType.getCode,
|
||||||
|
org.apache.hadoop.hbase::KeyValue::Type::DeleteColumn.getCode)
|
||||||
|
del = @test_table._createdelete_internal('104', 'x:a', 1212, [], false)
|
||||||
|
assert_equal(del.get('x'.to_java_bytes, 'a'.to_java_bytes).get(0).getType.getCode,
|
||||||
|
org.apache.hadoop.hbase::KeyValue::Type::Delete.getCode)
|
||||||
|
del = @test_table._createdelete_internal('104', 'x', 1212)
|
||||||
|
assert_equal(del.get('x'.to_java_bytes, nil).get(0).getType.getCode,
|
||||||
|
org.apache.hadoop.hbase::KeyValue::Type::DeleteFamily.getCode)
|
||||||
|
del = @test_table._createdelete_internal('104', 'x', 1212, [], false)
|
||||||
|
assert_equal(del.get('x'.to_java_bytes, nil).get(0).getType.getCode,
|
||||||
|
org.apache.hadoop.hbase::KeyValue::Type::DeleteFamilyVersion.getCode)
|
||||||
|
end
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
define_test "deleteall should work w/o columns and timestamps" do
|
define_test "deleteall should work w/o columns and timestamps" do
|
||||||
|
|
Loading…
Reference in New Issue