@Override
  public String getTaskStatus() throws HiveSQLException {
    if (driver != null) {
      List<QueryDisplay.TaskDisplay> statuses = driver.getQueryDisplay().getTaskDisplays();
      if (statuses != null) {
        try (final ByteArrayOutputStream out = new ByteArrayOutputStream()) {
          QueryDisplay.OBJECT_MAPPER.writeValue(out, statuses);
          return out.toString(StandardCharsets.UTF_8.name());
        } catch (Exception e) {
          throw new HiveSQLException(e, queryState.getQueryId());
        }
      }
    }
    // Driver not initialized
    return null;
  }
Returns the current UGI on the stack

@return UserGroupInformation

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