core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java
/**
   * Locates expressions that can be reduced to literals or converted to
   * expressions with redundant casts removed.
   *
   * @param typeFactory    Type factory
   * @param exps           list of candidate expressions to be examined for
   *                       reduction
   * @param constants      List of expressions known to be constant
   * @param constExps      returns the list of expressions that can be constant
   *                       reduced
   * @param addCasts       indicator for each expression that can be constant
   *                       reduced, whether a cast of the resulting reduced
   *                       expression is potentially necessary
   * @param removableCasts returns the list of cast expressions where the cast
   */
Locates expressions that can be reduced to literals or converted to
expressions with redundant casts removed.


Locates expressions that can be reduced to literals or converted to expressions with redundant casts removed .
private static void findReducibleExps(RelDataTypeFactory typeFactory,
      List<RexNode> exps, ImmutableMap<RexNode, RexLiteral> constants,
      List<RexNode> constExps, List<Boolean> addCasts,
      List<RexNode> removableCasts) {
    ReducibleExprLocator gardener =
        new ReducibleExprLocator(typeFactory, constants, constExps,
            addCasts, removableCasts);
    for (RexNode exp : exps) {
      gardener.analyze(exp);
    }
    assert constExps.size() == addCasts.size();
  }
private static void findReducibleExps ( RelDataTypeFactory typeFactory , List < RexNode > exps , ImmutableMap < RexNode , RexLiteral > constants , List < RexNode > constExps , List < Boolean > addCasts , List < RexNode > removableCasts ) { ReducibleExprLocator gardener = new ReducibleExprLocator ( typeFactory , constants , constExps , addCasts , removableCasts ) ; for ( RexNode exp : exps ) { gardener . analyze ( exp ) ; } assert constExps . size ( ) == addCasts . size ( ) ; }
Locates expressions that can be reduced to literals or converted to
 expressions with redundant casts removed.
Locates expressions that can be reduced to literals or converted to expressions with redundant casts removed .