Updated on 2023-07-11 GMT+08:00

Using HiveQL Editor on the Hue Web UI

Scenario

Users can use the Hue web UI to execute HiveQL statements in an MRS cluster.

Access Editor

  1. Access the Hue web UI. For details, see Accessing the Hue Web UI.
  2. In the navigation tree on the left, click and choose Hive. The Hive page is displayed.

    Hive supports the following functions:

    • Executes and manages HiveQL statements.
    • Views the HiveQL statements saved by the current user in Saved Queries.
    • Queries HiveQL statements executed by the current user in Query History.

Executing HiveQL Statements

  1. Select a Hive database from the Database drop-down list box. The default database is default.

    The system displays all available tables. You can enter a keyword of the table name to search for the desired table.

  2. Click the desired table name. All columns in the table are displayed.

    Move the cursor to the row where the table or column is located and click . Column details are displayed.

  3. Enter the query statements in the area for editing HiveQL statements.
  4. Click to execute the HiveQL statements.

    Figure 1 Executing a statement
    • If you want to use the entered HiveQL statements again, click to save them.
    • Advanced query configuration:

      Click in the upper right corner to configure information such as files, functions, and settings.

    • Viewing the information of shortcut keys:

      Click in the upper right corner to view the syntax and keyboard shortcut information.

    • To delete an entered HiveQL statement, click the triangle next to and select Clear.
    • Viewing history:

      Click Query History to view the HiveQL 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.

Viewing Execution Results

  1. View the execution results below the execution area on Hive. The Query History tab page is displayed by default.
  2. Click a result to view the execution result of the executed statement.

    Hue does not support the display of a large amount of data. When a large number of SQL query results are loaded, the page may be frozen and some data may not be displayed. It is recommended that no more than 5,000 lines of query results be loaded.

Managing Query Statements

  1. Click Saved Queries.
  2. Click a saved statement. The system automatically adds the statement to the editing area.

Modifying the Session Configuration of the Hue Editor

  1. On the editor page, click .
  2. Click on the right of Files, and then click to select files.

    You can click next to Files to add a file resource.

  3. In the Functions area, enter a user-defined name and the class name of the function.

    You can click next to Functions to add a customized function.

  4. In the Settings area, enter the Hive parameter name in the Key, and value in Value. The current Hive session connects to Hive based on the customized configuration.

    You can click to add a parameter.