Authenticating from a JDBC client

On the Hive or Impala client side, use the JWT token as a Standard Authorization Bearer token by either specifying it in a JWT environment variable or by specifying the token directly in the JDBC connection string.

Authenticating from a JDBC client requires one of the following prerequistes:
  • Connect from your client to a Hive or Impala Virtual Warehouse.
  • Connect from your client to a Unified Analytics Virtual Warehouse of the Impala type using the Unified Anaytics JDBC driver.
You can download the required driver from the Cloudera Data Warehouse Overview page. Click See More from the Resources and Download tile and select the required driver to download.
Specify the JWT token you copied in "Generating a JWT token from the CDP side" as a JWT environment variable, and then construct a Beeline command.
Hive example:
export JWT=[***JWT token***]

beeline -u "jdbc:hive2://<your-virtual-warehouse>.<your-environment>.<dwx.company.com>/default;transportMode=http;httpPath=cliservice;ssl=true;retries=3;auth=jwt"

Impala example using the Unified Analytics JDBC driver and a Unified Analytics Impala Virtual Warehouse:

export JWT=[***JWT token***]

beeline -u "jdbc:impala://<your-virtual-warehouse>.<your-environment>.<dwx.company.com>/default;transportMode=http;httpPath=cliservice;ssl=true;retries=3;auth=jwt"
Alternatively, specify the JWT token directly in the JDBC URL connection string.
Hive example:
beeline -u "jdbc:hive2://<your-virtual-warehouse>.<your-environment>.<dwx.company.com>/default;transportMode=http;httpPath=cliservice;ssl=true;retries=3;jwt=[***JWT token***]"

Impala example using the Unified Analytics JDBC driver and a Unified Analytics Impala Virtual Warehouse:

beeline -u "jdbc:impala://<your-virtual-warehouse>.<your-environment>.<dwx.company.com>/default;transportMode=http;httpPath=cliservice;ssl=true;retries=3;jwt=[***JWT token***]"
You can now query the Virtual Warehouse from the client side.