HBASE-24335 Support deleteall with ts but without column in shell mode (#1668)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>
(cherry picked from commit 2cafe81e9c
)
This commit is contained in:
parent
f49fc24ecf
commit
9dd8c9607c
|
@ -183,12 +183,14 @@ EOF
|
|||
visibility = args[VISIBILITY]
|
||||
set_cell_visibility(d, visibility) if visibility
|
||||
end
|
||||
if column && all_version
|
||||
family, qualifier = parse_column_name(column)
|
||||
d.addColumns(family, qualifier, timestamp)
|
||||
elsif column && !all_version
|
||||
family, qualifier = parse_column_name(column)
|
||||
d.addColumn(family, qualifier, timestamp)
|
||||
if column != ""
|
||||
if column && all_version
|
||||
family, qualifier = parse_column_name(column)
|
||||
d.addColumns(family, qualifier, timestamp)
|
||||
elsif column && !all_version
|
||||
family, qualifier = parse_column_name(column)
|
||||
d.addColumn(family, qualifier, timestamp)
|
||||
end
|
||||
end
|
||||
d
|
||||
end
|
||||
|
|
|
@ -30,12 +30,16 @@ row key prefix. Examples:
|
|||
hbase> deleteall 't1', 'r1'
|
||||
hbase> deleteall 't1', 'r1', 'c1'
|
||||
hbase> deleteall 't1', 'r1', 'c1', ts1
|
||||
//'' means no specific column, will delete all cells in the row which timestamp is lower than
|
||||
//the one specified in the command
|
||||
hbase> deleteall 't1', 'r1', '', ts1
|
||||
hbase> deleteall 't1', 'r1', 'c1', ts1, {VISIBILITY=>'PRIVATE|SECRET'}
|
||||
|
||||
ROWPREFIXFILTER can be used to delete row ranges
|
||||
hbase> deleteall 't1', {ROWPREFIXFILTER => 'prefix'}
|
||||
hbase> deleteall 't1', {ROWPREFIXFILTER => 'prefix'}, 'c1' //delete certain column family in the row ranges
|
||||
hbase> deleteall 't1', {ROWPREFIXFILTER => 'prefix'}, 'c1', ts1
|
||||
hbase> deleteall 't1', {ROWPREFIXFILTER => 'prefix'}, '', ts1
|
||||
hbase> deleteall 't1', {ROWPREFIXFILTER => 'prefix'}, 'c1', ts1, {VISIBILITY=>'PRIVATE|SECRET'}
|
||||
|
||||
CACHE can be used to specify how many deletes batched to be sent to server at one time, default is 100
|
||||
|
|
|
@ -115,6 +115,9 @@ module Hbase
|
|||
@test_table.put(105, "x:a", "3")
|
||||
@test_table.put(105, "x:a", "4")
|
||||
|
||||
@test_table.put(106, "x:a", "3", 1588765900000)
|
||||
@test_table.put(106, "x:b", "4", 1588765900010)
|
||||
|
||||
@test_table.put("111", "x:a", "5")
|
||||
@test_table.put("111", "x:b", "6")
|
||||
@test_table.put("112", "x:a", "5")
|
||||
|
@ -168,6 +171,14 @@ module Hbase
|
|||
assert_nil(res)
|
||||
end
|
||||
|
||||
define_test "deleteall should work with timestamps but w/o columns" do
|
||||
@test_table.deleteall("106", "", 1588765900005)
|
||||
res = @test_table._get_internal('106', 'x:a')
|
||||
assert_nil(res)
|
||||
res = @test_table._get_internal('106', 'x:b')
|
||||
assert_not_nil(res)
|
||||
end
|
||||
|
||||
define_test "deleteall should work with integer keys" do
|
||||
@test_table.deleteall(105)
|
||||
res = @test_table._get_internal('105', 'x:a')
|
||||
|
|
Loading…
Reference in New Issue