Specifying the data to retrieve from a Cloudera system
HQL supports many of the same keywords as SQL, for example, SELECT, WHERE, GROUP BY, ORDER BY, JOIN, and UNION. The following is an example of a very simple HQL query that selects all from table_1:
SELECT *
FROM table_1
How to specify what data to retrieve from a Cloudera system
1 In Data Explorer, right-click Data Sets, then choose New Data Set.
2 In New Data Set, specify the following information:
1 In Data Source Selection, select the Cloudera Hive data source to use. Data Set Type displays HQL Select Query.
2 In Data Set Name, type a name for the data set.
3 Choose Next.
3 In HQL Query, in Query text, type a HQL statement that indicates what data to retrieve. Figure 6‑15 shows an example of an HQL query specified in the data set editor.
Figure 6‑15 Data set editor displaying an HQL query
4 Choose Finish to save the data set. Edit Data Set displays the columns, and provides options for editing the data set, as shown in Figure 6‑16.
Figure 6‑16 Data set editor displaying the output columns
5 Choose Preview Results to view the data rows returned by the data set, as shown in Figure 6‑17. When finished, choose OK.
Figure 6‑17 Previewing query results