private RexNode visit(final RexNode call) {
      RexNode replacement = replacements.get(call.toString());
      if (replacement == null) {
        return null;
      }
      if (replacement.getType().equals(call.getType())) {
        return replacement;
      }
      return rexBuilder.makeCast(call.getType(), replacement, true);
    }
Planner rule that infers constant expressions from Filter into
a Project operator.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveProjectFilterPullUpConstantsRule.java