Running a Hive Query¶
The page explains how to run a simple Hive query from the QDS UI. You must have an active QDS account; to create a new account, see Managing Your Accounts.
Step 1: Explore Tables¶
Navigate to the Workbench page.
Click the Tables tab. You will see a list of databases.
- Click on a database to view the list of all the tables in it.
- All accounts have access to two pre-configured tables in the default database: default_qubole_airline_origin_destination and default_qubole_memetracker.
- To see the list of columns in a specific table, click on the arrow sign to the left of the table name.
Step 2: View Sample Rows¶
Now, execute a simple query against this table by entering the following text in the query box:
select * from default_qubole_memetracker limit 10
Click Run. Within a few seconds, you should see 10 rows from the table show up in the Results tab.
Figure: View Some Rows
Step 3: Analyze Data¶
To get the total number of rows in the table corresponding to August 2008, use the following query:
select count(*) from default_qubole_memetracker where month="2008-08".
This query is more complex than the previous one and requires additional resources. Behind the scenes, QDS provisions a Hadoop cluster, which may take a couple of minutes.
Once the cluster is provisioned, you can follow the query’s progress under the Log tab.
When the query completes, you can see the logs and results under the respective tabs.
See also: Composing a Hive Query.