delete

Definition

Deletes a cell value at the specified table/row/column and optionally timestamp coordinates.

Usage

delete '[<namespace_name>:]<table_name>',
       '<row_key>',
       '<column_family:column_qualifier>'[,
       <cell_timestamp>][,
       {VISIBILITY => '<visibility_expression>'}]
Arguments
Parameter Description

namespace_name

A namespace name

table_name

A table name

row_key

A row key

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: | (or), & (and). Examples: SECRET|PRIVATE, (SECRET&PRIVATE)|PUBLIC, SECRET&PRIVATE&PUBLIC

Examples

Deleting a value at the specified table/row/column coordinates that has no previous versions

hbase(main):002:0> scan 't4'
ROW                                      COLUMN+CELL
 r1                                      column=cf1:c1, timestamp=1637324524743, value=value1
 r1                                      column=cf1:c2, timestamp=2222221111111, value=value2
 r1                                      column=cf1:c3, timestamp=1637326735791, value=value3_new
 r1                                      column=cf1:c4, timestamp=1637324859512, value=value4
 r1                                      column=cf1:c5, timestamp=1637329193429, value=7738718b
1 row(s)
Took 0.3796 seconds
hbase(main):003:0> delete 't4', 'r1', 'cf1:c1'
Took 0.0750 seconds
hbase(main):004:0> scan 't4'
ROW                                      COLUMN+CELL
 r1                                      column=cf1:c2, timestamp=2222221111111, value=value2
 r1                                      column=cf1:c3, timestamp=1637326735791, value=value3_new
 r1                                      column=cf1:c4, timestamp=1637324859512, value=value4
 r1                                      column=cf1:c5, timestamp=1637329193429, value=7738718b
1 row(s)
Took 0.0086 seconds

Deleting a value at the specified table/row/column coordinates that has previous versions

hbase(main):009:0> delete 't4', 'r1', 'cf1:c5'
Took 0.0181 seconds
hbase(main):010:0> scan 't4'
ROW                                      COLUMN+CELL
 r1                                      column=cf1:c2, timestamp=2222221111111, value=value2
 r1                                      column=cf1:c3, timestamp=1637326735791, value=value3_new
 r1                                      column=cf1:c4, timestamp=1637324859512, value=value4
 r1                                      column=cf1:c5, timestamp=1637329190124, value=7738718a
1 row(s)
Took 0.0074 seconds

Deleting the specified value version

hbase(main):011:0> scan 't4', {VERSIONS => 5}
ROW                                      COLUMN+CELL
 r1                                      column=cf1:c2, timestamp=2222221111111, value=value2
 r1                                      column=cf1:c3, timestamp=1637326735791, value=value3_new
 r1                                      column=cf1:c4, timestamp=1637324859512, value=value4
 r1                                      column=cf1:c5, timestamp=1637329190124, value=7738718a
 r1                                      column=cf1:c5, timestamp=1637329187604, value=7738718W
 r1                                      column=cf1:c5, timestamp=1637328326920, value=7738718M
1 row(s)
Took 0.0091 seconds
hbase(main):012:0> delete 't4', 'r1', 'cf1:c5', 1637329187604
Took 0.0047 seconds
hbase(main):013:0> scan 't4', {VERSIONS => 5}
ROW                                      COLUMN+CELL
 r1                                      column=cf1:c2, timestamp=2222221111111, value=value2
 r1                                      column=cf1:c3, timestamp=1637326735791, value=value3_new
 r1                                      column=cf1:c4, timestamp=1637324859512, value=value4
 r1                                      column=cf1:c5, timestamp=1637329190124, value=7738718a
 r1                                      column=cf1:c5, timestamp=1637328326920, value=7738718M
1 row(s)
Took 0.0078 seconds
Found a mistake? Seleсt text and press Ctrl+Enter to report it