@Override
  public String getQueryId(TOperationHandle opHandle) throws HiveSQLException {
    Operation operation = sessionManager.getOperationManager().getOperation(
        new OperationHandle(opHandle));
    final String queryId = operation.getQueryId();
    LOG.debug(opHandle + ": getQueryId() " + queryId);
    return queryId;
  }
If this is a background operation run asynchronously,
we block for a duration determined by a step function, before we return
However, if the background operation is complete, we return immediately.
service/src/java/org/apache/hive/service/cli/CLIService.java