Hue provides the Hive GUI management function so that users can query Hive data in GUI mode.
Access the Hue web UI. For details, see Accessing the Hue Web UI.
In the navigation tree on the left, click
and choose Hive. The Hive page is displayed.
Select the target database on the left. You can also click
in the upper right corner and enter the target database name to search for the target database.
Enter a Hive HQL statement in the text box and click
or press Ctrl+Enter to run the HQL statement. The execution result is displayed on the Result tab page.
Select the target database on the left, enter the Hive HQL statement in the text box, and click
to compile the HQL statement and check whether the statement is correct. The execution result is displayed under the text editing box.
Enter the Hive HQL statement in the text box, click
in the upper right corner, and enter the name and description. You can view the saved statements on the Saved Queries tab page.
Click Query History to view the HQL running status. You can view the history of all the statements or only the saved statements. If many historical records exist, you can enter keywords in the text box to search for desired records.
Click
in the upper right corner to configure the file, function, and settings.
Click
in the upper right corner to view information about all shortcut keys.
Access the Hue web UI. For details, see Accessing the Hue Web UI.
Click
in the navigation tree on the left and click a table name. The metadata of the Hive table is displayed.
On the metadata information page of a Hive table:
View the field information of each column in a Hive table and manually add description information. Note that the added description information is not the field comments in the Hive table.
Click
in the left list to create a table based on the uploaded file in the database. You can also manually create a table.
The Hue page is used to view and analyze data such as files and tables. Do not perform high-risk management operations such as deleting objects on the page. If an operation is required, you are advised to perform the operation on each component after confirming that the operation has no impact on services. For example, you can use the HDFS client to perform operations on HDFS files and use the Hive client to perform operations on Hive tables.
On the Hue page, create a Hive table as follows:
at the upper left corner of Hue web UI and select the Hive instance to be operated to enter the Hive command execution page.create table hue_table(id int,name string,company string) row format delimited fields terminated by ',' stored as textfile;
Click
to execute the HQL statements.
show tables;
Click
to view the created table hue_table in Result.