@Override
  public void cancel(OperationState stateAfterCancel) throws HiveSQLException {
    String queryId = null;
    if (stateAfterCancel == OperationState.CANCELED) {
      queryId = queryState.getQueryId();
      log.info("Cancelling the query execution: {}", queryId);
    }
    cleanup(stateAfterCancel);
    cleanupOperationLog(operationLogCleanupDelayMs);
    if (stateAfterCancel == OperationState.CANCELED) {
      log.info("Successfully cancelled the query: {}", queryId);
    }
  }
Returns the current UGI on the stack

@return UserGroupInformation

@throws HiveSQLException
service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java