Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25989

CTLT HBaseStorageHandler is dropping underlying HBase table when failed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      With hive.strict.managed.tables & hive.create.as.acid, 

      Hive-Hbase rollback code is assuming it is a createTable failure instead of CTLT & removing underlying hbase table while rolling back at here.
      https://github.com/apache/hive/blob/master/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseMetaHook.java#L187-L195

       

      Repro

       

      hbase
      =====
      hbase shell
      create 'hbase_hive_table', 'cf'
      beeline
      =======
      set hive.support.concurrency=true;
      set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
      set hive.strict.managed.tables=true;
      set hive.create.as.acid=true;
      set hive.create.as.insert.only=true;
      set hive.default.fileformat.managed=ORC;
      > CREATE EXTERNAL TABLE `hbase_hive_table`(                       
         `key` int COMMENT '',                            
         `value` string COMMENT '')                       
       ROW FORMAT SERDE                                   
         'org.apache.hadoop.hive.hbase.HBaseSerDe'        
       STORED BY                                          
         'org.apache.hadoop.hive.hbase.HBaseStorageHandler'  
       WITH SERDEPROPERTIES (                             
         'hbase.columns.mapping'=':key,cf:cf')                      
       TBLPROPERTIES ('hbase.table.name'='hbase_hive_table');
      > select * from hbase_hive_table;
      +-----------------------+-------------------------+
      | hbase_hive_table.key  | hbase_hive_table.value  |
      +-----------------------+-------------------------+
      +-----------------------+-------------------------+
      > create table new_hbase_hive_table like hbase_hive_table;
      Caused by: org.apache.hadoop.hive.metastore.api.MetaException: The table must be stored using an ACID compliant format (such as ORC): default.new_hbase_hive_table
      > select * from hbase_hive_table;
      Error: java.io.IOException: org.apache.hadoop.hbase.TableNotFoundException: hbase_hive_table
      

      Attachments

        Issue Links

          Activity

            People

              Marton Bod Marton Bod
              nareshpr Naresh P R
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m