Submit a Quantum Query

POST /api/v1.2/commands/

Use this API to submit a Quantum query.

Required Role

The following users can make this API call:

  • Users who belong to the system-user or system-admin group.
  • Users who belong to a group associated with a role that allows submitting a command. See Managing Groups and Managing Roles for more information.
Parameter Description
command_type It denotes the type of the query. It must be SqlCommand for a Quantum query.
query Specify the Quantum query to run. You can also specify the Hive DDL. The supported DDLs are listed in Supported Hive DDLs.
name Add a name to the command that is useful while filtering commands from the command history. It does not accept & (ampersand), < (lesser than), > (greater than), ” (double quotes), and ‘ (single quote) special characters, and HTML tags as well. It can contain a maximum of 255 characters.
tags Add a tag to a command so that it is easily identifiable and searchable from the commands list in the Commands History. Add a tag as a filter value while searching commands. It can contain a maximum of 255 characters. A comma-separated list of tags can be associated with a single command. While adding a tag value, enclose it in square brackets. For example, {"tags":["<tag-value>"]}.


Sample 1: Run a Quantum query to see the tables in the Hive metastore.

curl  -i -X POST -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
-d '{"query":"show tables;", "command_type": "SqlCommand"}' \ ""

Sample 2: Run aa Quantum query to see the quarter’s list for a specific year 2007.

curl  -i -X POST -H "X-AUTH-TOKEN: $AUTH_TOKEN" -H "Content-Type: application/json" -H "Accept: application/json" \
-d {"query":"select quarter, count(*) from default_qubole_airline_origin_destination where year='2007' group by quarter;",
"command_type": "SqlCommand"}' \ ""