Using Apache Hive
Also available as:
PDF

Alter a table from flat to transactional

You might have a flat table, which is a non-transactional table in the Hive warehouse, present from earlier releases. You can use an ALTER TABLE statement to change a table from flat to transactional.

Upon completion of the task, you can immediately run update and delete operations on the table.

  1. Start the Hive shell:
    From the command line:hive
  2. Enter your user name and password.
    The Hive 3 connection message appears, followed by the Hive prompt for entering queries on the command line:
    Connected to: Apache Hive (version 3.0.0.3.0.0.0-1361)
    Driver: Hive JDBC (version 3.0.0.3.0.0.0-1361)
    Transaction isolation: TRANSACTION_REPEATABLE_READ
    Beeline version 3.0.0.3.0.0.0-1361 by Apache Hive
                            
    0: jdbc:hive2://c7402.ambari.apache.org:2181,>
  3. Alter the flat table to make it transactional.
    ALTER TABLE T3 SET TBLPROPERTIES ('transactional'='true');