As a Hive user who connects to CDW from a client, you need to know how to set up the
client for using HPL/SQL.
-
On the client end, download the latest version of the Hive JDBC driver from
Cloudera Downloads page.
-
Install the driver on the client end.
Typically, you add the JAR file to the Libraries folder.
-
Log into the CDP web interface and navigate to the Data Warehouse
service.
-
In the Data Warehouse service, click Virtual Warehouse in the left navigation
panel.
-
On the Virtual Warehouses page, click the options menu of the Hive VW you want
to connect to, and select Copy JDBC URL.
-
Paste the copied JDBC URL into a text file.
jdbc:hive2://<your-virtual-warehouse>.<your-environment>.<dwx.company.com>/default;transportMode=http;httpPath=cliservice;ssl=true;retries=3
-
Append
mode=hplsql
to the end of the JDBC URL for connecting
to CDW from the client.
jdbc:hive2://<your-virtual-warehouse>.<your-environment>.<dwx.company.com>/default;transportMode=http;httpPath=cliservice;ssl=true;retries=3;mode=hplsql
-
On the client end, use the URL in Beeline to connect to CDW and enable
HPL/SQL.
beeline -n <csso_username> -p <password> -u "jdbc:hive2://<your-virtual-warehouse>.<your-environment>.<dwx.company.com>/default;transportMode=http;httpPath=cliservice;ssl=true;retries=3;mode=hplsql"
At the Hive prompt, you can run HPL/SQL. You can use the forward slash (/) as
a statement delimiter because a HPL/SQL statement can have multiple rows
consisting of multiple SQL statements.