Using the Passcode token

After copying the Passcode token, you need to connect from a client to a Hive or Impala Virtual Warehouse in CDW. You see how to construct the connection string that a client uses to connect to CDW using token-based authentication.

To create the Beeline connection command, you get the connection string for Hive or Impala to use with the Passcode token.
  1. On the client end, download the latest version of the Hive JDBC driver from Cloudera Downloads page.
  2. Install the driver on the client end.
    Typically, you add the JAR file to the Libraries folder.
  3. Log into the CDP web interface and navigate to the Data Warehouse service.
  4. In the Data Warehouse service, click Virtual Warehouse in the left navigation panel.
  5. In a Virtual Warehouse, click options , and select Copy JDBC URL.
  6. 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
  7. Edit the JDBC URL to construct a Beeline command that connects to the Virtual Warehouse, using the word token (literally) as the user name and using the Passcode Token you copied earlier as the password.
    beeline -u "jdbc:hive2://my-vw.my-env.dwx.mycompany.com/default;transportMode=http;httpPath=cliservice;ssl=true;retries=3" -n token -p {PasscodeToken}

    After pasting your Passcode Token at the end of the command, the command looks something like this:

    beeline -u "jdbc:hive2://my-vw.my-env.dwx.mycompany.com/default;transportMode=http;httpPath=cliservice;ssl=true;retries=3" -n token -p 294a07f4-5ae5-40ed-b45c-d4076693ae11
  8. Execute the beeline command, and then you can run queries on the Hive or Impala Virtual Warehouse.