Composing a Hive Query

Use the command composer on the Workbench page to compose a Hive query.

See Hive in Qubole for more information.

Note

Hadoop clusters support Hive queries. See Mapping of Cluster and Command Types for more information.

Perform the following steps to compose a Hive query:

  1. Navigate to the Workbench page and click + Create New.

  2. Select the Hive tab (near the top of the page).

  3. Either:

    1. To use a stored query, select Query Path from the drop-down list near the top right of the page, then specify the Cloud storage path that contains the Hive query file. Click Run to execute the query.

    Or:

    1. Enter your Hive query in the text field (Query Statement is selected by default in the drop-down list near the top right of the page; this is what you want in this case). Click Run to execute the query.

You can use the Status tab in the bottom half of the screen to monitor the progress of your job; this tab also displays useful debugging information if the query does not succeed.

You can see the result under the Results tab, and the logs under the Logs tab. For more information on how to download command results and logs and logs, see Downloading Results and Logs.

Note

Log for a particular Hive query is available at <Default location>/cluster_inst_id/<cmd_id>.log.gz.

Viewing a Detailed Hive Log

A detailed log for each Hive query executed using HiveServer2 or Hive-on-coordinator can be uploaded to a subdirectory in the default location in Cloud storage within a couple of minutes of query completion. Detailed logs are not available by default. Create a ticket with Qubole Support to enable this capability.

Once it’s enabled, you can find the location of the logs in the Logs tab of the Workbench page.

Viewing Multi-line Column Data in Query Results

Qubole supports newline (\n) and carriage return (\r) characters in Hive query results by escaping them in the Hive result set and then un-escaping in the UI; this prevents any problems with the display of multi-line columns. To enable this capability, create a ticket with Qubole Support. Note that once it’s enabled, even a simple SELECT query requires a cluster start.