Using Query Plan Graph View for Hive Web UI

Visualize your query plans with the Query Plan Graph View in the Hive Web User Interface.

Benefits of the Query Plan Graph View

Use the Query Plan Graph View to:

  • Follow in real-time as your Hive query executes.
  • Watch MapReduce jobs unfold on the progress bar and examine their statistics.
  • See clearly which tasks in a plan are executed and which are filtered out.
  • Find logs for the individual stages of a query execution plan.
  • Spot errors quickly.
  • Pinpoint problems for failed or hanging queries.

Query Plan Graph View Overview

The query plan graph maps out every step of your query execution plan and indicates the current status of each step with a color:

Color

Execution Step Status

Green

Successfully completed

Red

Error occurred

Blue

Currently executing

Grey

Might mean one of the following:
  • Waiting for preceding stages to complete before executing.
  • Not executed. Query plans can include conditional tasks that are followed with divergent paths. The conditional task determines which path to use and which to filter out. The paths that are filtered out do not execute. It is not unusual for a query plan to contain unexecuted tasks. For example, see the image below.
  • Fetch task. Hive fetch tasks, which directly fetch data using hadoop fs -get or hadoop fs -cat are always shown in grey because Hive does not update their status. In the below image, the final task is a fetch task and it is grey.
The Query Plan Graph View
A screenshot of the Query Plan Graph View during the execution process.

An example of the Query Plan Graph View during the execution process.

Activating the Query Plan Graph View

Follow these steps to enable the Query Plan Graph View in your HiveServer2 Web User Interface.

  1. Log in to the Cloudera Manager Admin Console.
  2. Click Clusters in the top navigation bar, and choose Hive from the list of service instances.

    Choose Hive from the list of service instances.

  3. Click the Configuration tab on the Hive service page to edit the configuration.
  4. In the Search field, search for Service Advanced Configuration Snippet (Safety Valve) for hive-site.xml
  5. Click the plus sign (+), and add the following configurations one at a time to the Service Advanced Configuration Snippet (Safety Valve):
    Name Value Description (optional)

    hive.server2.webui.explain.output

    true

    Set this to true to log EXPLAIN EXTENDED output for the query in HiveServer2 WebUI / Drilldown / Query Plan.

    hive.server2.webui.show.graph

    true

    Set this to true to display the Query Plan Graph View instead of text in the WebUI.

    hive.server2.webui.max.graph.size

    40

    The maximum number of stages the Query Plan Graph View can display. Recommended value: 40 (for the best view). Default value: 25.

    hive.server2.webui.show.stats

    true

    Set this to true to display the statistics and log files of MapReduce tasks in the WebUI.

    Configuring the Service Advanced Configuration Snippet (Safety Valve)
    Configuring the Service Advanced Configuration Snippet (Safety Valve)

  6. Enter a Reason for change, and then click Save Changes to commit the changes.
  7. After your change is saved, click the restart icon above the Configuration tab.


    If you don’t see the reset icon, try refreshing your browser.

  8. Click Restart Stale Services, and then click Restart Now.
  9. Click Finish after the restart completes.

Viewing the Query Plan Graph View

View the Query Plan Graph in the query Drilldown page at any time during or after executing a query. To find it:

  1. Log in to the Cloudera Manager Admin Console.
  2. Click Clusters in the top navigation bar, and choose Hive from the list of service instances.

    Choose Hive from the list of service instances.

  3. Click the HiveServer2 Web UI in the Hive toolbar, and select the HiveServer2 Web UI for the cluster node that you want to view.

    The HS2 Web UI icon

  4. On the HiveServer2 page, find your query and click Drilldown to view more details. The query could be listed under Open Queries or Closed Queries depending on its status.
  5. Click the Query Plan tab on the Drilldown page to open the Query Plan Graph View.
  6. Select any step of the plan to see a detailed view of that stage and its statistics. These appear below the graph.