Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-26895

on hbase shell, 'delete/deleteall' for a columnfamily is not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha-2, 2.4.11
    • 2.5.0, 3.0.0-alpha-3, 2.4.12
    • shell
    • None

    Description

      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)

       

              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.
       

       

       

      Attachments

        Issue Links

          Activity

            People

              eomiks jeongmin kim
              jeongmin.kim Jeongmin Kim
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: