Using Apache HiveQL
Also available as:
PDF

Create a CRUD transactional table

You create a CRUD transactional table when you need a managed table that you can update, delete, and merge.

In this task, you create a CRUD transactional table on the command line. You cannot sort this type of table. Bucketing is optional in Hive 3 and does not affect performance. You must use STORED AS ORC in the schema definition of a CRUD transactional table as shown in the task example. Implementing a storage handler that supports AcidInputFormat and AcidOutputFormat is equivalent to specifying ORC storage used in this task.

  1. Start Hive from the Beeline shell:
    # hive
  2. Enter your user name and password.
    The Hive 3 connection message, followed by the Hive prompt for entering HiveQL queries on the command line, appears.
  3. Create a CRUD transactional table named T having two integer columns, a and b:
    CREATE TABLE T(a int, b int) 
      STORED AS ORC;