Creating Hive ACID Transaction Tables
About this Task
Using Hive View 2.0 of Ambari, you can enable ACID-based transactions so that you can create tables that support transactional SQL. Hive View 2.0 also lets you export the DDL of the table to fully functional scripts.
Steps
In Ambari, select Configs.
> >On the Settings subtab, set the ACID Transactions slider to
On
:Click
.Enter an annotation about the change.
If the Dependent Configurations window appears, review the recommended changes. You can modify the settings if you need to do so for your cluster environment.
Open Hive View 2.0. One way that you can do this is by clicking the palette icon in the upper right corner of the Ambari window, as shown in the following screenshot.
Select COLUMNS subtab.
button >Define the column name and data type for each column of your table. Click the ADVANCED configuration wheel for the column to be the key column.
After clicking the ADVANCED configuration wheel for the column to be set as the key column, designate the clustering key by clicking the Clustered checkbox.
Click the ADVANCED subtab. Click the Transactional checkbox and enter your value for the Number of buckets field.
Click the +Create button toward the bottom of the Ambari window.
(Optional) Click the DDL subtab to view the SQL of the table so that you can copy it, use it as a template for other tables, and export it as a script. This can help with understanding and possibly reusing the DDL in a production environment where you do not want to use a GUI tool, such as in a Beeline CLI.