private boolean executeInner(List target) {
    sink.reset(target);
    int rowsRet;
    if (cachingEnabled) {
      rowsRet = work.getLimit() >= 0 ? work.getLimit() : Integer.MAX_VALUE;
    } else {
      rowsRet = work.getLeastNumRows();
      if (rowsRet <= 0) {
        rowsRet = work.getLimit() >= 0 ? Math.min(work.getLimit() - totalRows, maxRows) : maxRows;
      }
    }

    try {
      if (rowsRet <= 0 || work.getLimit() == totalRows) {
        fetch.clearFetchContext();
        return false;
      }
      boolean fetched = false;
      while (sink.getNumRows() < rowsRet) {
        if (!fetch.pushRow()) {
          if (work.getLeastNumRows() > 0) {
            throw new HiveException("leastNumRows check failed");
          }

          // Closing the operator can sometimes yield more rows (HIVE-11892)
          fetch.closeOperator();

          return fetched;
        }
        fetched = true;
      }
      return true;
    } catch (Exception e) {
      console.printError("Failed with exception " + e.getClass().getName() + ":" + e.getMessage(),
          "\n" + org.apache.hadoop.util.StringUtils.stringifyException(e));
      throw new RuntimeException(e);
    } finally {
      totalRows += sink.getNumRows();
    }
  }
Clear the Fetch Operator.

@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/exec/FetchTask.java