// Verify cleanup functionality.
// Open a new session, since this case needs to close the session in the end.
SessionHandle sessionHandleCleanup = setupSession();
// prepare
OperationHandle operationHandle = client.executeStatement(sessionHandleCleanup, sql, null);
RowSet rowSetLog = client.fetchResults(operationHandle, FetchOrientation.FETCH_FIRST, 1000,
FetchType.LOG);
verifyFetchedLog(rowSetLog);
File sessionLogDir = new File(
hiveConf.getVar(HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LOG_LOCATION) +
File.separator + sessionHandleCleanup.getHandleIdentifier());
File operationLogFile = new File(sessionLogDir, operationHandle.getHandleIdentifier().toString());
// check whether exception is thrown when fetching log from a closed operation.
client.closeOperation(operationHandle);
try {
client.fetchResults(operationHandle, FetchOrientation.FETCH_FIRST, 1000, FetchType.LOG);