Jeongmin Kim created HBASE-26895:
------------------------------------

             Summary: on hbase shell, 'delete/deleteall' for a columnfamily is 
not working
                 Key: HBASE-26895
                 URL: https://issues.apache.org/jira/browse/HBASE-26895
             Project: HBase
          Issue Type: Bug
          Components: shell
    Affects Versions: 2.4.11, 3.0.0-alpha-2
            Reporter: Jeongmin Kim
             Fix For: 3.0.0-alpha-3, 2.4.12


on hbase shell,

'delete' or 'deleteall' for the whole columnFamily is not working properly.

```

hbase(main):026:0* put 'test', 'r1', 'f:1', 'a'
Took 0.0233 seconds

hbase(main):029:0> delete 'test', 'r1', 'f'
Took 0.0070 seconds
hbase(main):030:0> get 'test', 'r1'
COLUMN                                                                  CELL
 f:1                                                                    
timestamp=1648114865022, value=a
1 row(s)

hbase(main):038:0> deleteall 'test', 'r1', 'f'
Took 0.0059 seconds
hbase(main):039:0> get 'test', 'r1'
COLUMN                                                                  CELL
 f:1                                                                    
timestamp=1648114865022, value=a
1 row(s)

```

 

looking inside of hbase-shell,

all delete/deleteall on hbase shell are converted to 
delete.addColumn/addColumns.

thus, delete/deleteall request without columnQualifier converted to 'null' 
qualifier deletion. (since HBASE-15616, null columnQualifier is possible)

 

```ruby

        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

```

 

According to the description of help 'deleteall' and HBASE-9549
> "Users of the shell, MapReduce, REST, and Thrift who wish to interact with an 
> *entire column family must use "family"* instead of "family:" (notice the 
> omitted ':'). Including the ':' will be interpreted as an interaction with 
> the empty qualifier in the "family" column family."
 
a column expression without ':' means whole family.
so in these cases, it's deletion request for the columnFamily,
and we should use addFamily/addFamilyVersion instead of addColumn/addColumns 
for deletion.
 

 

 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to