You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Duo Zhang (Jira)" <ji...@apache.org> on 2022/04/12 13:05:00 UTC

[jira] [Resolved] (HBASE-26895) on hbase shell, 'delete/deleteall' for a columnfamily is not working

     [ https://issues.apache.org/jira/browse/HBASE-26895?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Duo Zhang resolved HBASE-26895.
-------------------------------
    Fix Version/s: 2.5.0
         Assignee: Jeongdae Kim
       Resolution: Fixed

> 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: 3.0.0-alpha-2, 2.4.11
>            Reporter: Jeongmin Kim
>            Assignee: Jeongdae Kim
>            Priority: Major
>             Fix For: 2.5.0, 3.0.0-alpha-3, 2.4.12
>
>
> on hbase shell,
> 'delete' or 'deleteall' for the whole columnFamily is not working properly.
>  
> {code:java}
> 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) {code}
>  
> 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)
>  
> {code:java}
>         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 {code}
>  
> 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)