Help Center/ MapReduce Service/ Component Operation Guide (LTS)/ Using Hue/ Creating a Hue Job/ Using Hue to Execute HetuEngine SQL Statements
Updated on 2024-10-09 GMT+08:00

Using Hue to Execute HetuEngine SQL Statements

Scenario

You can use Hue to execute HetuEngine statements in a cluster on a UI.

Prerequisites

  • The HetuEngine component has been installed in the MRS cluster and the HSFabric instance has been added. The Hue service needs to be restarted when HSFabric instances are added, deleted, migrated, or when ports are modified.
  • A human-machine HetuEngine administrator user, for example, hetu_user, has been created in the cluster. For details, see Creating a HetuEngine Permission Role. For clusters with Ranger authentication enabled, the Ranger permission must be added to user hetu_user based on service requirements. For details, see Adding a Ranger Access Permission Policy for HetuEngine.
  • A compute instance has been created and is running properly. For details, see Creating a HetuEngine Compute Instance.

Access the Editor

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

    HetuEngine supports the following functions:

    • Execute and manage HetuEngine SQL statements.
    • View HetuEngine SQL statements saved by the current user in Saved Queries.
    • Query HetuEngine SQL statements executed by the current user in Query History.

Executing HetuEngine SQL Statements

  1. Enter a HetuEngine statement in the editor.
  2. Click to execute the HetuEngine SQL statement.

    Figure 1 Executing a statement
    • Only one HetuEngine statement can be executed at a time on Hue.
    • By default, catalog=hive and schema=default are used to execute a HetuEngine statement on Hue. You can use the SQL syntax use <catalog>.<schema> to switch the schema.
    • If you want to use the entered HetuEngine SQL statement next time, click to save it.
    • On the Hue page, you cannot specify a tenant to run a job. Instead, a default tenant is randomly selected from the tenant list associated with the user to run the job.
    • Viewing history

      Click Query History to view the status of historical HetuEngine SQL statements. You can choose to view the status of all statements or only the saved statements. If there are many historical records, 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 HetuEngine. The Query History tab 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.