Download SSL Certificate

By default, the gateway has been configured with a self-signed certificate to protect the Hive endpoint via SSL. Therefore, in order to use Hive via JDBC or Beeline client, you must download the SSL certificate from
the gateway and add it to your truststore.

Alternatively, you can configure your own trusted certificate. If you choose this option, do not perform the SSL certificate download steps listed below. Instead, follow the instructions for
Using Your Own SSL Certificate.

On Linux or OSX, you can download the self-signed SSL certificate using the following commands:

Where:
GATEWAY_ADDRESS - Set this to the IP address of the controller node instance.
GATEWAY_JKS_PASSWORD - Create a password for the truststore that will hold the self-signed certificate. The password must be at least 6 characters length.

Hive JDBC

Hive can be accessed via JDBC through the Protected Gateway that is automatically installed and configured in your cluster. If your cluster configuration includes Hive LLAP, then Hive LLAP is configured with the gateway; otherwise, HiveServer2 is configured. In either case, the transport mode is “http”
and the gateway path to Hive is "${CLUSTER_NAME}/services/hive".

Before you can start using Hive JDBC, you must download the SSL certificate to your truststore. After downloading the SSL certificate, the Hive JDBC endpoint is:

Example: SQL Workbench/J

SQL Workbench/J is a cross-platform SQL tool that can be used to access database systems. In this example, we will provide a high-level overview of the steps required to setup SQL Workbench to access Hive via JDBC.

Click to create a new driver, and enter the Name: “Hortonworks Hive JDBC”.

Click and then browse to the Hortonworks JDBC Driver for Apache Hive package that you downloaded earlier. Next, select the JDBC Driver JAR files in the package.

When prompted, select the “com.simba.hive.jdbc41.HS2Driver” driver.

For the Sample URL, enter: jdbc:hive2://${GATEWAY_HOSTNAME}:443/

Click OK to save the driver.

Step 2: Create a Connection to Hive

From the Select Connection Profile window, select the “Hortonworks Hive JDBC" from the Driver dropdown.

For URL , enter the URL to the controller, such as jdbc:hive2://ec2-52-86-252-73.compute-1.amazonaws.com:443/ (where ec2-52-86-252-73.compute-1.amazonaws.com is the public hostname of your controller node).

For Username and Password, enter the credentials that you created when creating your cluster.

After performing these steps, your configuration should look similar to:

Click OK to save the properties.

Click Test to confirm a connection can be established.

Click OK to make the connection and start using SQL Workbench to query Hive.

Example: Tableau

Tableau is a business intelligence tool for interacting with and
visualizing data via SQL. Connecting Tableau to Hive requires the use of an ODBC driver. In this
example, we will provide high-level steps required to set up Tableau to access Hive.