@Override
  public TableSchema getResultSetSchema() throws HiveSQLException {
    // Since compilation is always a blocking RPC call, and schema is ready after compilation,
    // we can return when are in the RUNNING state.
    assertState(Arrays.asList(OperationState.RUNNING, OperationState.FINISHED));
    if (!resultSchema.isPresent()) {
      resultSchema = Optional.of(new TableSchema(driver.getSchema()));
    }
    return resultSchema.get();
  }
Returns the current UGI on the stack

@return UserGroupInformation

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