@Test
  public void testFetchResultsOfLogWithPerformanceMode() throws Exception {
    try {
      String queryString = "set hive.server2.logging.operation.level=performance";
      client.executeStatement(sessionHandle, queryString, null);
      // verify whether the sql operation log is generated and fetch correctly.
      OperationHandle operationHandle = client.executeStatement(sessionHandle, sqlCntStar, null);
      RowSet rowSetLog = client.fetchResults(operationHandle, FetchOrientation.FETCH_FIRST, 100000,
        FetchType.LOG);
      // rowSetLog should contain execution as well as performance logs
      verifyFetchedLog(rowSetLog, expectedLogsExecution);
      verifyFetchedLog(rowSetLog, expectedLogsPerformance);
      verifyMissingContentsInFetchedLog(rowSetLog, expectedLogsVerbose);
    } finally {
      // Restore everything to default setup to avoid discrepancy between junit test runs
      String queryString2 = "set hive.server2.logging.operation.level=verbose";
      client.executeStatement(sessionHandle, queryString2, null);
    }
  }
Open a session, and create a table for cases usage
@throws Exception
itests/hive-unit/src/test/java/org/apache/hive/service/cli/operation/OperationLoggingAPITestBase.java