@Override
  public boolean hasResultSet() {
    // TODO explain should use a FetchTask for reading
    for (Task<?> task : driverContext.getPlan().getRootTasks()) {
      if (task.getClass() == ExplainTask.class) {
        return true;
      }
    }

    return driverContext.getPlan().getFetchTask() != null && driverContext.getPlan().getResultSchema() != null &&
        driverContext.getPlan().getResultSchema().isSetFieldSchemas();
  }
Release some resources after a query is executed while keeping the result around.
ql/src/java/org/apache/hadoop/hive/ql/Driver.java