use of org.apache.hive.service.cli.RowSet in project hive by apache.
the class OperationLoggingAPITestBase method testFetchResultsOfLogWithNoneMode.
@Test
public void testFetchResultsOfLogWithNoneMode() throws Exception {
try {
String queryString = "set hive.server2.logging.operation.level=none";
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, 1000, FetchType.LOG);
// We should not get any rows.
assert (rowSetLog.numRows() == 0);
} 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);
}
}
use of org.apache.hive.service.cli.RowSet in project hive by apache.
the class OperationLoggingAPITestBase method testFetchResultsOfLogWithVerboseMode.
@Test
public void testFetchResultsOfLogWithVerboseMode() throws Exception {
String queryString = "set hive.server2.logging.operation.level=verbose";
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, 1000, FetchType.LOG);
// Verbose Logs should contain everything, including execution and performance
verifyFetchedLog(rowSetLog, expectedLogsVerbose);
verifyFetchedLog(rowSetLog, expectedLogsExecution);
verifyFetchedLog(rowSetLog, expectedLogsPerformance);
}
Aggregations