put

Definition

Inserts a cell value at the specified table, row, column, and optionally timestamp coordinates.

Usage

put '[<namespace_name>:]<table_name>',
    '<row_key>',
    '<column_family>:<column_qualifier>',
    '<cell_value>'[,
    <cell_timestamp>][,
    {ATTRIBUTES => {'<cell_attribute_name>' => '<cell_attribute_value>'[,...]}}][,
    {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_value

A value for the inserted cell

cell_timestamp

A cell timestamp

cell_attribute_name

A cell attribute name

cell_attribute_value

A value of the specified cell attribute

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

Putting a value without timestamp and any attributes

hbase(main):001:0> put 't4', 'r1', 'cf1:c1', 'value1'
Took 0.5673 seconds
hbase(main):002:0> get 't4', 'r1'
COLUMN                                   CELL
 cf1:c1                                  timestamp=1637324524743, value=value1
1 row(s)
Took 0.0396 seconds

Putting a value with the predefined timestamp

hbase(main):009:0> put 't4', 'r1', 'cf1:c2', 'value2', 2222221111111
Took 0.0073 seconds
hbase(main):010:0> get 't4', 'r1'
COLUMN                                   CELL
 cf1:c1                                  timestamp=1637324524743, value=value1
 cf1:c2                                  timestamp=2222221111111, value=value2
1 row(s)
Took 0.0104 seconds

Putting a value with additional attributes

hbase(main):011:0> put 't4', 'r1', 'cf1:c3', 'value3', {ATTRIBUTES => {'my_prop_name' => 'my_prop_value'}}
Took 0.0123 seconds
hbase(main):012:0> get 't4', 'r1'
COLUMN                                   CELL
 cf1:c1                                  timestamp=1637324524743, value=value1
 cf1:c2                                  timestamp=2222221111111, value=value2
 cf1:c3                                  timestamp=1637324768581, value=value3
1 row(s)
Took 0.0086 seconds

Putting a value with visibility assigning

hbase(main):013:0> put 't4', 'r1', 'cf1:c4', 'value4', {VISIBILITY => 'SECRET'}
Took 0.0231 seconds
hbase(main):014:0> get 't4', 'r1'
COLUMN                                   CELL
 cf1:c1                                  timestamp=1637324524743, value=value1
 cf1:c2                                  timestamp=2222221111111, value=value2
 cf1:c3                                  timestamp=1637324768581, value=value3
 cf1:c4                                  timestamp=1637324859512, value=value4
1 row(s)
Took 0.0109 seconds
Found a mistake? Seleсt text and press Ctrl+Enter to report it