public void close(boolean abort) throws HiveException {
    LOG.debug("Close Called for Operator: {}", this);

    if (state == State.CLOSE) {
      return;
    }

    // check if all parents are finished
    if (!allInitializedParentsAreClosed()) {
      LOG.debug("Not all parent operators are closed. Not closing.");
      return;
    }

    // set state as CLOSE as long as all parents are closed
    // state == CLOSE doesn't mean all children are also in state CLOSE
    state = State.CLOSE;
    LOG.info("Closing Operator: {}", this);

    abort |= abortOp.get();

    // call the operator specific close routine
    closeOp(abort);

    // closeOp can be Overridden
    if (conf != null && conf.getRuntimeStatsTmpDir() != null) {
      publishRunTimeStats();
    }
    LongWritable runTimeRowsWritable = new LongWritable(runTimeNumRows);
    LongWritable recordCounter = new LongWritable(numRows);
    statsMap.put(Counter.RECORDS_OUT_OPERATOR.name() + "_" + getOperatorId(), runTimeRowsWritable);
    statsMap.put(getCounterName(Counter.RECORDS_OUT_INTERMEDIATE, hconf), recordCounter);
    this.runTimeNumRows = 0;

    reporter = null;

    try {
      logStats();
      if (childOperators == null) {
        return;
      }

      for (Operator<? extends OperatorDesc> op : childOperators) {
        LOG.debug("Closing Child: {} ", op);
        op.close(abort);
      }

      LOG.debug("Close Done: {}", this);
    } catch (HiveException e) {
      LOG.warn("Caught exception while closing operator", e);
      throw e;
    }
  }
Process the row.

@param row
         The object representing the row.
@param tag
         The tag of the row usually means which parent this row comes from.
         Rows with the same tag should have exactly the same rowInspector
         all the time.
ql/src/java/org/apache/hadoop/hive/ql/exec/Operator.java