private static void propagate(GenericUDF udf, List<ExprNodeDesc> newExprs, RowSchema rs,
      Map<ColumnInfo, ExprNodeDesc> constants) {
    if (udf instanceof GenericUDFOPEqual) {
      ExprNodeDesc lOperand = newExprs.get(0);
      ExprNodeDesc rOperand = newExprs.get(1);
      ExprNodeConstantDesc v;
      if (lOperand instanceof ExprNodeConstantDesc) {
        v = (ExprNodeConstantDesc) lOperand;
      } else if (rOperand instanceof ExprNodeConstantDesc) {
        v = (ExprNodeConstantDesc) rOperand;
      } else {
        // we need a constant on one side.
        return;
      }
      // If both sides are constants, there is nothing to propagate
      ExprNodeColumnDesc c;
      if (lOperand instanceof ExprNodeColumnDesc) {
        c = (ExprNodeColumnDesc)lOperand;
      } else if (rOperand instanceof ExprNodeColumnDesc) {
        c = (ExprNodeColumnDesc)rOperand;
      } else {
        // we need a column expression on other side
        // NOTE: we also cannot rely on column expressions wrapped inside casts as casting might
        // truncate information
        return;
      }
      ColumnInfo ci = resolveColumn(rs, c);
      if (ci != null) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Filter {} is identified as a value assignment, propagate it.",
              udf.getDisplayString(new String[]{lOperand.getExprString(), rOperand.getExprString()}));
        }
        if (!v.getTypeInfo().equals(ci.getType())) {
          v = typeCast(v, ci.getType(), true);
        }
        if (v != null) {
          constants.put(ci, v);
        }
      }
    } else if (udf instanceof GenericUDFOPNull) {
      ExprNodeDesc operand = newExprs.get(0);
      if (operand instanceof ExprNodeColumnDesc) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Filter {} is identified as a value assignment, propagate it.",
              udf.getDisplayString(new String[]{operand.getExprString()}));
        }
        ExprNodeColumnDesc c = (ExprNodeColumnDesc) operand;
        ColumnInfo ci = resolveColumn(rs, c);
        if (ci != null) {
          constants.put(ci, new ExprNodeConstantDesc(ci.getType(), null));
        }
      }
    }
  }
Propagate assignment expression, adding an entry into constant map constants.

@param udf expression UDF, currently only 2 UDFs are supported: '=' and 'is null'.
@param newExprs child expressions (parameters).
@param cppCtx
@param op
@param constants
ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java