@Test
  public void checkWebUIShowStats() throws Exception {
    // WebUI-related boolean confs must be set before build. HIVE_SERVER2_WEBUI_SHOW_STATS depends
    // on HIVE_SERVER2_WEBUI_EXPLAIN_OUTPUT and HIVE_SERVER2_WEBUI_SHOW_GRAPH being set to true.
    conf.setBoolVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_EXPLAIN_OUTPUT, true);
    conf.setBoolVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_SHOW_GRAPH, true);
    conf.setIntVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_MAX_GRAPH_SIZE, 40);
    conf.setBoolVar(HiveConf.ConfVars.HIVE_SERVER2_WEBUI_SHOW_STATS, true);

    HiveSession session = sessionManager
        .createSession(new SessionHandle(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8),
            TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8, "testuser", "", "",
            new HashMap<String, String>(), false, "");
    SessionState.start(conf);

    OperationHandle opHandleSetup =
        session.executeStatement("CREATE TABLE statsTable (i int)", null);
    session.closeOperation(opHandleSetup);
    OperationHandle opHandleQuery =
        session.executeStatement("INSERT INTO statsTable VALUES (0)", null);
    session.closeOperation(opHandleQuery);

    // INSERT queries include a Tez task.
    verifyDDLHtml("DagId", opHandleQuery.getHandleIdentifier().toString(), true);

    session.close();
    resetConfToDefaults();
  }
Test for the HiveConf option HIVE_SERVER2_WEBUI_SHOW_STATS, which is available for Tez
jobs only.
itests/hive-unit/src/test/java/org/apache/hive/service/cli/session/TestQueryDisplay.java