diff --git a/hbase-shell/src/main/ruby/hbase/table.rb b/hbase-shell/src/main/ruby/hbase/table.rb index 68d7349c00a..dae1e106f50 100644 --- a/hbase-shell/src/main/ruby/hbase/table.rb +++ b/hbase-shell/src/main/ruby/hbase/table.rb @@ -244,7 +244,11 @@ EOF # delete operation doesn't need read permission. Retaining the read check for # meta table as a part of HBASE-5837. if is_meta_table? - raise ArgumentError, 'Row Not Found' if _get_internal(row).nil? + if row.is_a?(Hash) and row.key?('ROWPREFIXFILTER') + raise ArgumentError, 'deleteall with ROWPREFIXFILTER in hbase:meta is not allowed.' + else + raise ArgumentError, 'Row Not Found' if _get_internal(row).nil? + end end if row.is_a?(Hash) _deleterows_internal(row, column, timestamp, args, all_version) diff --git a/hbase-shell/src/test/ruby/hbase/table_test.rb b/hbase-shell/src/test/ruby/hbase/table_test.rb index ee6f0f58967..cb274f814aa 100644 --- a/hbase-shell/src/test/ruby/hbase/table_test.rb +++ b/hbase-shell/src/test/ruby/hbase/table_test.rb @@ -194,6 +194,13 @@ module Hbase assert_nil(res2) end + define_test "deleteall with row prefix in hbase:meta should not be allowed." do + assert_raise(ArgumentError) do + @meta_table = table('hbase:meta') + @meta_table.deleteall({ROWPREFIXFILTER => "test_meta"}) + end + end + define_test "append should work with value" do @test_table.append("123", 'x:cnt2', '123') assert_equal("123123", @test_table._append_internal("123", 'x:cnt2', '123'))