private boolean checkSetDone(Object row, int tag) {
    if (row instanceof VectorizedRowBatch) {
      // We need to check with 'instanceof' instead of just checking
      // vectorized because the row can be a VectorizedRowBatch when
      // FetchOptimizer kicks in even if the operator pipeline is not
      // vectorized
      VectorizedRowBatch batch = (VectorizedRowBatch) row;
      if (currCount >= rowLimit) {
        setDone(true);
        return true;
      }
      if (currCount + batch.size > rowLimit) {
        batch.size = rowLimit - currCount;
      }
      currCount += batch.size;
    } else if (currCount++ >= rowLimit) {
      setDone(true);
      return true;
    }
    return false;
  }
Other than gathering statistics for the ANALYZE command, the table scan operator
does not do anything special other than just forwarding the row. Since the table
data is always read as part of the map-reduce framework by the mapper. But, when this
assumption stops to be true, i.e table data won't be only read by the mapper, this
operator will be enhanced to read the table.
ql/src/java/org/apache/hadoop/hive/ql/exec/TableScanOperator.java