public void onMatch(RelOptRuleCall call) {
    final Project project = call.rel(0);
    final Filter filter = call.rel(1);
    final RelBuilder builder = call.builder();

    List<RexNode> projects = project.getProjects();
    List<RexNode> newProjects = rewriteProjects(projects, filter.getCondition(), builder);
    if (newProjects == null) {
      return;
    }

    RelNode newProjRel = builder.push(filter)
            .project(newProjects, project.getRowType().getFieldNames()).build();
    call.transformTo(newProjRel);
  }
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