deleteall
Contents
Definition
Deletes all cells with previous versions from the specified row. Requires a table name, a row key, and optionally — a column name and a timestamp. Allows to use a prefix filter instead of a row key.
CAUTION
Even if you specify a timestamp, the command deletes all cells of the specified column, not only having the defined timestamp.
|
Usage
deleteall '[<namespace_name>:]<table_name>',
'<row_key>' | {ROWPREFIXFILTER => '<row_prefix>'}[,
'<column_family>:<column_qualifier>'[,
<cell_timestamp>]][,
{VISIBILITY => '<visibility_expression>'}]
Parameter | Description |
---|---|
namespace_name |
A namespace name |
table_name |
A table name |
row_key |
A row key |
row_prefix |
A prefix for searching row keys |
column_family |
A column family name |
column_qualifier |
A column qualifier |
cell_timestamp |
A cell timestamp |
visibility_expression |
A logical expression that refers to existing visibility labels. Can use the following logical operators: |
Examples
Deleting all cells values from the specified row
hbase(main):079:0> scan 't6', VERSIONS => 5 ROW COLUMN+CELL r1 column=cf1:c1, timestamp=1637426986008, value=value3 r1 column=cf1:c1, timestamp=1637426972064, value=value2 r1 column=cf1:c1, timestamp=1637426961063, value=value1 r1 column=cf1:c2, timestamp=1637426521080, value=value4 r2 column=cf1:c3, timestamp=1637427026420, value=value6 r2 column=cf1:c3, timestamp=1637426999070, value=value5 2 row(s) Took 0.0066 seconds hbase(main):080:0> deleteall 't6', 'r1' Took 0.0067 seconds hbase(main):081:0> scan 't6', VERSIONS => 5 ROW COLUMN+CELL r2 column=cf1:c3, timestamp=1637427026420, value=value6 r2 column=cf1:c3, timestamp=1637426999070, value=value5 1 row(s) Took 0.0054 seconds
Using ROWPREFIXFILTER
hbase(main):048:0> scan 't6', VERSIONS => 5 ROW COLUMN+CELL r1 column=cf1:c1, timestamp=1637426380000, value=value3 r1 column=cf1:c1, timestamp=1637426378038, value=value2 r1 column=cf1:c1, timestamp=1637426371683, value=value1 r1 column=cf1:c2, timestamp=1637426387651, value=value4 r2 column=cf1:c3, timestamp=1637426397389, value=value6 r2 column=cf1:c3, timestamp=1637426395621, value=value5 2 row(s) Took 0.0437 seconds hbase(main):049:0> deleteall 't6', {ROWPREFIXFILTER => 'r'} Took 0.0546 seconds hbase(main):050:0> scan 't6', VERSIONS => 5 ROW COLUMN+CELL 0 row(s) Took 0.0051 seconds
Deleting all cells values from the specified column
hbase(main):057:0> scan 't6', VERSIONS => 5 ROW COLUMN+CELL r1 column=cf1:c1, timestamp=1637426519471, value=value3 r1 column=cf1:c1, timestamp=1637426517669, value=value2 r1 column=cf1:c1, timestamp=1637426515563, value=value1 r1 column=cf1:c2, timestamp=1637426521080, value=value4 r2 column=cf1:c3, timestamp=1637426525624, value=value6 r2 column=cf1:c3, timestamp=1637426523363, value=value5 2 row(s) Took 0.0121 seconds hbase(main):058:0> deleteall 't6', 'r1', 'cf1:c1' Took 0.0076 seconds hbase(main):059:0> scan 't6', VERSIONS => 5 ROW COLUMN+CELL r1 column=cf1:c2, timestamp=1637426521080, value=value4 r2 column=cf1:c3, timestamp=1637426525624, value=value6 r2 column=cf1:c3, timestamp=1637426523363, value=value5 2 row(s) Took 0.0061 seconds