@Override
    public void onMatch(RelOptRuleCall call) {
      LOG.debug("JDBCExpandExpressionsRule.ProjectionExpressions has been called");

      final Project project = call.rel(0);
      final RexBuilder rexBuilder = project.getCluster().getRexBuilder();
      boolean changed = false;
      List<RexNode> newProjects = new ArrayList<>();
      for (RexNode oldNode : project.getProjects()) {
        RexNode newNode = analyzeRexNode(rexBuilder, oldNode);
        if (!newNode.toString().equals(oldNode.toString())) {
          changed = true;
          newProjects.add(newNode);
        } else {
          newProjects.add(oldNode);
        }
      }

      if (!changed) {
        return;
      }

      Project newProject = project.copy(
          project.getTraitSet(),
          project.getInput(),
          newProjects,
          project.getRowType());
      call.transformTo(newProject);
    }
Rule adapter to apply the transformation to Projections.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/jdbc/JDBCExpandExpressionsRule.java