Configuring Impala Virtual Warehouses to create Impala tables in Kudu in Cloudera Data Warehouse Private Cloud
Cloudera Data Warehouse allows you to create Impala tables in Kudu. You can configure an Impala Virtual Warehouse to connect to Kudu and create Impala tables in Kudu using Hue. Or, you can create tables on the fly by specifying the Kudu master host in the TBLPROPERTIES statement while running the query from the Hue query editor.
Obtain the hostname of the Kudu master home by going tofrom the CDP Management Console.
Creating Imapla tables in Kudu on the fly
To create Impala tables in Kudu without updating a Virtual Warehouse’s Impala coordinator configuration, you must specify the Kudu master host in the TBLPROPERTIES statement as follows while running the query from Hue:
Configuring the Virtual Warehouse to create Impala tables in Kudu
By reconfiguring an existing Impala Virtual Warehouse as follows, any tables you create will be created in Kudu.
- Log in to the Cloudera Data Warehouse service as a DWAdmin.
- Go to an Impala Virtual Warehouse and click flagfile from the drop-down list. and select
Click and enter the following key and value:
- Click APPLY.
- Restart the Virtual Warehouse.
- Open Hue from the same Virtual Warehouse.
Enter the following lines in the query editor and click the run button:
# Create a new table # Use the kudu.num_tablet_replicas if the Kudu cluster is too small CREATE TABLE my_first_table ( id BIGINT, name STRING, PRIMARY KEY(id) ) PARTITION BY HASH PARTITIONS 16 STORED AS KUDU TBLPROPERTIES ('kudu.num_tablet_replicas' = '1'); # Insert into Kudu table INSERT INTO my_first_table VALUES (99, "sarah"); # Verify if the data was inserted SELECT * FROM my_first_table;The above commands create an Impala table in Kudu and insert a sample record. The following is a screenshot showing the SQL commands and their output in Hue: