public boolean isIdentitySelect() {
    // Safety check
    if(this.getNumParent() != 1) {
      return false;
    }

    if(conf.isSelStarNoCompute()) {
      return true;
    }

    // Check whether the have the same schema
    RowSchema orig = this.getSchema();
    RowSchema dest = this.getParentOperators().get(0).getSchema();
    if(orig.getSignature() == null && dest.getSignature() == null) {
      return true;
    }
    if((orig.getSignature() == null && dest.getSignature() != null) ||
        (orig.getSignature() != null && dest.getSignature() == null) ) {
      return false;
    }

    if(orig.getSignature().size() != dest.getSignature().size() ||
            orig.getSignature().size() != conf.getColList().size()) {
      return false;
    }

    for(int i=0; i<orig.getSignature().size(); i++) {
      ColumnInfo origColumn = orig.getSignature().get(i);
      ColumnInfo destColumn = dest.getSignature().get(i);

      if(origColumn == null && destColumn == null) {
        continue;
      }

      if((origColumn == null && destColumn != null) ||
          (origColumn != null && destColumn == null) ) {
        return false;
      }

      if(!origColumn.internalEquals(destColumn)) {
        return false;
      }

      // Now we check if though the schemas are the same,
      // the operator changes the order of columns in the
      // output
      if(!(conf.getColList().get(i) instanceof ExprNodeColumnDesc)) {
        return false;
      }
      ExprNodeColumnDesc col = (ExprNodeColumnDesc) conf.getColList().get(i);
      if(!col.getColumn().equals(origColumn.getInternalName())) {
        return false;
      }

    }

    return true;
  }
Checks whether this select operator does something to the
input tuples.

@return if it is an identity select operator or not
ql/src/java/org/apache/hadoop/hive/ql/exec/SelectOperator.java