Class RexUtil


  • public class RexUtil
    extends java.lang.Object
    Utility methods concerning row-expressions.
    • Field Detail

      • EXECUTOR

        public static final RexExecutor EXECUTOR
        Executor for a bit of constant reduction. The user can pass in another executor.
    • Constructor Detail

      • RexUtil

        private RexUtil()
    • Method Detail

      • getSelectivity

        public static double getSelectivity​(RexNode exp)
        Returns a guess for the selectivity of an expression.
        Parameters:
        exp - expression of interest, or null for none (implying a selectivity of 1.0)
        Returns:
        guessed selectivity
      • generateCastExpressions

        public static java.util.List<RexNode> generateCastExpressions​(RexBuilder rexBuilder,
                                                                      RelDataType lhsRowType,
                                                                      RelDataType rhsRowType)
        Generates a cast from one row type to another
        Parameters:
        rexBuilder - RexBuilder to use for constructing casts
        lhsRowType - target row type
        rhsRowType - source row type; fields must be 1-to-1 with lhsRowType, in same order
        Returns:
        cast expressions
      • generateCastExpressions

        public static java.util.List<RexNode> generateCastExpressions​(RexBuilder rexBuilder,
                                                                      RelDataType lhsRowType,
                                                                      java.util.List<RexNode> rhsExps)
        Generates a cast for a row type.
        Parameters:
        rexBuilder - RexBuilder to use for constructing casts
        lhsRowType - target row type
        rhsExps - expressions to be cast
        Returns:
        cast expressions
      • isNullLiteral

        public static boolean isNullLiteral​(RexNode node,
                                            boolean allowCast)
        Returns whether a node represents the NULL value.

        Examples:

        • For RexLiteral Unknown, returns false.
        • For CAST(NULL AS type), returns true if allowCast is true, false otherwise.
        • For CAST(CAST(NULL AS type) AS type)), returns false.
      • isNull

        public static boolean isNull​(RexNode expr)
        Returns whether a node represents the NULL value or a series of nested CAST(NULL AS type) calls. For example: isNull(CAST(CAST(NULL as INTEGER) AS VARCHAR(1))) returns true.
      • isLiteral

        public static boolean isLiteral​(RexNode node,
                                        boolean allowCast)
        Returns whether a node represents a literal.

        Examples:

        • For CAST(literal AS type), returns true if allowCast is true, false otherwise.
        • For CAST(CAST(literal AS type) AS type)), returns false.
        Parameters:
        node - The node, never null.
        allowCast - whether to regard CAST(literal) as a literal
        Returns:
        Whether the node is a literal
      • allLiterals

        public static boolean allLiterals​(java.util.List<RexNode> expressionOperands)
        Returns whether every expression in a list is a literal.
        Parameters:
        expressionOperands - list of expressions to check
        Returns:
        true if every expression from the specified list is literal.
      • isReferenceOrAccess

        public static boolean isReferenceOrAccess​(RexNode node,
                                                  boolean allowCast)
        Returns whether a node represents an input reference or field access.
        Parameters:
        node - The node, never null.
        allowCast - whether to regard CAST(x) as true
        Returns:
        Whether the node is a reference or access
      • isNullabilityCast

        public static boolean isNullabilityCast​(RelDataTypeFactory typeFactory,
                                                RexNode node)
        Returns whether an expression is a cast just for the purposes of nullability, not changing any other aspect of the type.
      • removeNullabilityCast

        public static RexNode removeNullabilityCast​(RelDataTypeFactory typeFactory,
                                                    RexNode node)
        Removes any casts that change nullability but not type.

        For example, CAST(1 = 0 AS BOOLEAN) becomes 1 = 0.

      • predicateConstants

        public static <C extends RexNode> com.google.common.collect.ImmutableMap<RexNode,​C> predicateConstants​(java.lang.Class<C> clazz,
                                                                                                                     RexBuilder rexBuilder,
                                                                                                                     java.util.List<RexNode> predicates)
        Creates a map containing each (e, constant) pair that occurs within a predicate list.
        Type Parameters:
        C - what to consider a constant: RexLiteral to use a narrow definition of constant, or RexNode to use isConstant(RexNode)
        Parameters:
        clazz - Class of expression that is considered constant
        rexBuilder - Rex builder
        predicates - Predicate list
        Returns:
        Map from values to constants
      • overlap

        private static boolean overlap​(RexNode rexNode,
                                       java.util.Set<RexNode> set)
      • decompose

        private static void decompose​(java.util.Set<RexNode> set,
                                      RexNode rexNode)
        Tries to decompose the RexNode which is a RexCall into non-literal RexNodes.
      • gatherConstraints

        private static <C extends RexNode> void gatherConstraints​(java.lang.Class<C> clazz,
                                                                  RexNode predicate,
                                                                  java.util.Map<RexNode,​C> map,
                                                                  java.util.Set<RexNode> excludeSet,
                                                                  RexBuilder rexBuilder)
      • gatherConstraint

        private static <C extends RexNode> void gatherConstraint​(java.lang.Class<C> clazz,
                                                                 RexNode left,
                                                                 RexNode right,
                                                                 java.util.Map<RexNode,​C> map,
                                                                 java.util.Set<RexNode> excludeSet,
                                                                 RexBuilder rexBuilder)
      • canAssignFrom

        private static boolean canAssignFrom​(RelDataType type1,
                                             RelDataType type2)
        Returns whether a value of type2 can be assigned to a variable of type1.

        For example:

        • canAssignFrom(BIGINT, TINYINT) returns true
        • canAssignFrom(TINYINT, BIGINT) returns false
        • canAssignFrom(BIGINT, VARCHAR) returns false
      • isConstant

        public static boolean isConstant​(RexNode node)
        Returns whether node is made up of constants.
        Parameters:
        node - Node to inspect
        Returns:
        true if node is made up of constants, false otherwise
      • isDeterministic

        public static boolean isDeterministic​(RexNode e)
        Returns whether a given expression is deterministic.
        Parameters:
        e - Expression
        Returns:
        true if tree result is deterministic, false otherwise
      • retainDeterministic

        public static java.util.List<RexNode> retainDeterministic​(java.util.List<RexNode> list)
      • findOperatorCall

        public static RexCall findOperatorCall​(SqlOperator operator,
                                               RexNode node)
        Returns whether a given node contains a RexCall with a specified operator
        Parameters:
        operator - Operator to look for
        node - a RexNode tree
      • containsInputRef

        public static boolean containsInputRef​(RexNode node)
        Returns whether a given tree contains any {link RexInputRef} nodes.
        Parameters:
        node - a RexNode tree
      • containsFieldAccess

        public static boolean containsFieldAccess​(RexNode node)
        Returns whether a given tree contains any RexFieldAccess nodes.
        Parameters:
        node - a RexNode tree
      • requiresDecimalExpansion

        public static boolean requiresDecimalExpansion​(RexNode expr,
                                                       boolean recurse)
        Determines whether a RexCall requires decimal expansion. It usually requires expansion if it has decimal operands.

        Exceptions to this rule are:

        • isNull doesn't require expansion
        • It's okay to cast decimals to and from char types
        • It's okay to cast nulls as decimals
        • Casts require expansion if their return type is decimal
        • Reinterpret casts can handle a decimal operand
        Parameters:
        expr - expression possibly in need of expansion
        recurse - whether to check nested calls
        Returns:
        whether the expression requires expansion
      • requiresDecimalExpansion

        public static boolean requiresDecimalExpansion​(java.util.List<RexNode> operands,
                                                       boolean recurse)
        Determines whether any operand of a set requires decimal expansion
      • requiresDecimalExpansion

        public static boolean requiresDecimalExpansion​(RexProgram program,
                                                       boolean recurse)
        Returns whether a RexProgram contains expressions which require decimal expansion.
      • canReinterpretOverflow

        public static boolean canReinterpretOverflow​(RexCall call)
      • containNoCommonExprs

        public static boolean containNoCommonExprs​(java.util.List<RexNode> exprs,
                                                   Litmus litmus)
        Returns whether an array of expressions has any common sub-expressions.
      • containNoForwardRefs

        public static boolean containNoForwardRefs​(java.util.List<RexNode> exprs,
                                                   RelDataType inputRowType,
                                                   Litmus litmus)
        Returns whether an array of expressions contains no forward references. That is, if expression #i contains a RexInputRef referencing field i or greater.
        Parameters:
        exprs - Array of expressions
        inputRowType - Input row type
        litmus - What to do if an error is detected (there is a forward reference)
        Returns:
        Whether there is a forward reference
      • containNoNonTrivialAggs

        static boolean containNoNonTrivialAggs​(java.util.List<RexNode> exprs,
                                               Litmus litmus)
        Returns whether an array of exp contains no aggregate function calls whose arguments are not RexInputRefs.
        Parameters:
        exprs - Expressions
        litmus - Whether to assert if there is such a function call
      • containComplexExprs

        public static boolean containComplexExprs​(java.util.List<RexNode> exprs)
        Returns whether a list of expressions contains complex expressions, that is, a call whose arguments are not RexVariable (or a subtype such as RexInputRef) or RexLiteral.
      • containsTableInputRef

        public static boolean containsTableInputRef​(java.util.List<RexNode> nodes)
        Returns whether any of the given expression trees contains a {link RexTableInputRef} node.
        Parameters:
        nodes - a list of RexNode trees
        Returns:
        true if at least one was found, otherwise false
      • containsTableInputRef

        public static RexTableInputRef containsTableInputRef​(RexNode node)
        Returns whether a given tree contains any {link RexTableInputRef} nodes.
        Parameters:
        node - a RexNode tree
        Returns:
        first such node found or null if it there is no such node
      • isAtomic

        public static boolean isAtomic​(RexNode expr)
      • createStructType

        public static RelDataType createStructType​(RelDataTypeFactory typeFactory,
                                                   java.util.List<RexNode> exprs)
        Creates a record type with anonymous field names.
        Parameters:
        typeFactory - Type factory
        exprs - Expressions
        Returns:
        Record type
      • createStructType

        public static RelDataType createStructType​(RelDataTypeFactory typeFactory,
                                                   java.util.List<? extends RexNode> exprs,
                                                   java.util.List<java.lang.String> names,
                                                   SqlValidatorUtil.Suggester suggester)
        Creates a record type with specified field names.

        The array of field names may be null, or any of the names within it can be null. We recommend using explicit names where possible, because it makes it much easier to figure out the intent of fields when looking at planner output.

        Parameters:
        typeFactory - Type factory
        exprs - Expressions
        names - Field names, may be null, or elements may be null
        suggester - Generates alternative names if names is not null and its elements are not unique
        Returns:
        Record type
      • createStructType

        @Deprecated
        public static RelDataType createStructType​(RelDataTypeFactory typeFactory,
                                                   java.util.List<? extends RexNode> exprs,
                                                   java.util.List<java.lang.String> names)
        Deprecated.
      • makeKey

        public static Pair<RexNode,​java.lang.String> makeKey​(RexNode expr)
        Creates a key for RexNode which is the same as another key of another RexNode only if the two have both the same type and textual representation. For example, "10" integer and "10" bigint result in different keys.
      • containIdentity

        public static boolean containIdentity​(java.util.List<? extends RexNode> exprs,
                                              RelDataType rowType,
                                              Litmus litmus)
        Returns whether the leading edge of a given array of expressions is wholly RexInputRef objects with types corresponding to the underlying datatype.
      • isIdentity

        public static boolean isIdentity​(java.util.List<? extends RexNode> exps,
                                         RelDataType inputRowType)
        Returns whether a list of expressions projects the incoming fields.
      • composeConjunction

        public static RexNode composeConjunction​(RexBuilder rexBuilder,
                                                 java.lang.Iterable<? extends RexNode> nodes,
                                                 boolean nullOnEmpty)
        Converts a collection of expressions into an AND. If there are zero expressions, returns TRUE. If there is one expression, returns just that expression. If any of the expressions are FALSE, returns FALSE. Removes expressions that always evaluate to TRUE. Returns null only if nullOnEmpty and expression is TRUE.
      • flattenAnd

        public static com.google.common.collect.ImmutableList<RexNode> flattenAnd​(java.lang.Iterable<? extends RexNode> nodes)
        Flattens a list of AND nodes.

        Treats null nodes as literal TRUE (i.e. ignores them).

      • addAnd

        private static void addAnd​(com.google.common.collect.ImmutableList.Builder<RexNode> builder,
                                   java.util.Set<RexNode> digests,
                                   RexNode node)
      • composeDisjunction

        @Nonnull
        public static RexNode composeDisjunction​(RexBuilder rexBuilder,
                                                 java.lang.Iterable<? extends RexNode> nodes)
        Converts a collection of expressions into an OR. If there are zero expressions, returns FALSE. If there is one expression, returns just that expression. If any of the expressions are TRUE, returns TRUE. Removes expressions that always evaluate to FALSE. Flattens expressions that are ORs.
      • composeDisjunction

        public static RexNode composeDisjunction​(RexBuilder rexBuilder,
                                                 java.lang.Iterable<? extends RexNode> nodes,
                                                 boolean nullOnEmpty)
        Converts a collection of expressions into an OR, optionally returning null if the list is empty.
      • flattenOr

        public static com.google.common.collect.ImmutableList<RexNode> flattenOr​(java.lang.Iterable<? extends RexNode> nodes)
        Flattens a list of OR nodes.
      • addOr

        private static void addOr​(com.google.common.collect.ImmutableList.Builder<RexNode> builder,
                                  java.util.Set<RexNode> set,
                                  RexNode node)
      • apply

        public static java.util.List<RelCollation> apply​(Mappings.TargetMapping mapping,
                                                         java.util.List<RelCollation> collationList)
        Applies a mapping to a collation list.
        Parameters:
        mapping - Mapping
        collationList - Collation list
        Returns:
        collation list with mapping applied to each field
      • apply

        public static RelFieldCollation apply​(Mappings.TargetMapping mapping,
                                              RelFieldCollation fieldCollation)
        Applies a mapping to a field collation.

        If the field is not mapped, returns null.

        Parameters:
        mapping - Mapping
        fieldCollation - Field collation
        Returns:
        collation with mapping applied
      • applyFields

        public static java.util.List<RelFieldCollation> applyFields​(Mappings.TargetMapping mapping,
                                                                    java.util.List<RelFieldCollation> fieldCollations)
        Applies a mapping to a list of field collations.
        Parameters:
        mapping - Mapping
        fieldCollations - Field collations
        Returns:
        collations with mapping applied
      • apply

        public static java.lang.Iterable<RexNode> apply​(Mappings.TargetMapping mapping,
                                                        java.lang.Iterable<? extends RexNode> nodes)
        Applies a mapping to an iterable over expressions.
      • apply

        public static <T extends RexNode> T[] apply​(RexVisitor<T> shuttle,
                                                    T[] exprs)
        Applies a shuttle to an array of expressions. Creates a copy first.
        Parameters:
        shuttle - Shuttle
        exprs - Array of expressions
      • apply

        public static void apply​(RexVisitor<java.lang.Void> visitor,
                                 RexNode[] exprs,
                                 RexNode expr)
        Applies a visitor to an array of expressions and, if specified, a single expression.
        Parameters:
        visitor - Visitor
        exprs - Array of expressions
        expr - Single expression, may be null
      • apply

        public static void apply​(RexVisitor<java.lang.Void> visitor,
                                 java.util.List<? extends RexNode> exprs,
                                 RexNode expr)
        Applies a visitor to a list of expressions and, if specified, a single expression.
        Parameters:
        visitor - Visitor
        exprs - List of expressions
        expr - Single expression, may be null
      • flatten

        public static RexNode flatten​(RexBuilder rexBuilder,
                                      RexNode node)
        Flattens an expression.

        Returns the same expression if it is already flat.

      • flatten

        public static java.util.List<RexNode> flatten​(java.util.List<? extends RexNode> exprs,
                                                      SqlOperator op)
        Converts a list of operands into a list that is flat with respect to the given operator. The operands are assumed to be flat already.
      • isFlat

        private static boolean isFlat​(java.util.List<? extends RexNode> exprs,
                                      SqlOperator op)
        Returns whether a call to op with exprs as arguments would be considered "flat".

        For example, isFlat([w, AND[x, y], z, AND) returns false;

        isFlat([w, x, y, z], AND) returns true.

      • isFlat

        public static boolean isFlat​(RexNode expr)
        Returns false if the expression can be optimized by flattening calls to an associative operator such as AND and OR.
      • flattenRecurse

        private static void flattenRecurse​(java.util.List<RexNode> list,
                                           java.util.List<? extends RexNode> exprs,
                                           SqlOperator op)
      • isLosslessCast

        public static boolean isLosslessCast​(RexNode node)
        Returns whether the input is a 'loss-less' cast, that is, a cast from which the original value of the field can be certainly recovered.

        For instance, int → bigint is loss-less (as you can cast back to int without loss of information), but bigint → int is not loss-less.

        The implementation of this method does not return false positives. However, it is not complete.

      • toCnf

        public static RexNode toCnf​(RexBuilder rexBuilder,
                                    RexNode rex)
        Converts an expression to conjunctive normal form (CNF).

        The following expression is in CNF:

        (a OR b) AND (c OR d)

        The following expression is not in CNF:

        (a AND b) OR c

        but can be converted to CNF:

        (a OR c) AND (b OR c)

        The following expression is not in CNF:

        NOT (a OR NOT b)

        but can be converted to CNF by applying de Morgan's theorem:

        NOT a AND b

        Expressions not involving AND, OR or NOT at the top level are in CNF.

      • toCnf

        public static RexNode toCnf​(RexBuilder rexBuilder,
                                    int maxCnfNodeCount,
                                    RexNode rex)
        Similar to toCnf(RexBuilder, RexNode); however, it lets you specify a threshold in the number of nodes that can be created out of the conversion.

        If the number of resulting nodes exceeds that threshold, stops conversion and returns the original expression.

        If the threshold is negative it is ignored.

        Leaf nodes in the expression do not count towards the threshold.

      • toDnf

        public static RexNode toDnf​(RexBuilder rexBuilder,
                                    RexNode rex)
        Converts an expression to disjunctive normal form (DNF).

        DNF: It is a form of logical formula which is disjunction of conjunctive clauses.

        All logical formulas can be converted into DNF.

        The following expression is in DNF:

        (a AND b) OR (c AND d)

        The following expression is not in CNF:

        (a OR b) AND c

        but can be converted to DNF:

        (a AND c) OR (b AND c)

        The following expression is not in CNF:

        NOT (a OR NOT b)

        but can be converted to DNF by applying de Morgan's theorem:

        NOT a AND b

        Expressions not involving AND, OR or NOT at the top level are in DNF.

      • isAssociative

        private static boolean isAssociative​(SqlOperator op)
        Returns whether an operator is associative. AND is associative, which means that "(x AND y) and z" is equivalent to "x AND (y AND z)". We might well flatten the tree, and write "AND(x, y, z)".
      • exists

        public static <E> boolean exists​(java.util.List<? extends E> list,
                                         Predicate1<E> predicate)
        Returns whether there is an element in list for which predicate is true.
      • all

        public static <E> boolean all​(java.util.List<? extends E> list,
                                      Predicate1<E> predicate)
        Returns whether predicate is true for all elements of list.
      • shift

        public static java.lang.Iterable<RexNode> shift​(java.lang.Iterable<RexNode> nodes,
                                                        int offset)
        Shifts every RexInputRef in an expression by offset.
      • shift

        public static RexNode shift​(RexNode node,
                                    int start,
                                    int offset)
        Shifts every RexInputRef in an expression higher than start by offset.
      • pullFactors

        public static RexNode pullFactors​(RexBuilder rexBuilder,
                                          RexNode node)
        Creates an equivalent version of a node where common factors among ORs are pulled up.

        For example,

        (a AND b) OR (a AND c AND d)

        becomes

        a AND (b OR (c AND d))

        Note that this result is not in CNF (see toCnf(RexBuilder, RexNode)) because there is an AND inside an OR.

        This form is useful if, say, a contains columns from only the left-hand side of a join, and can be pushed to the left input.

        Parameters:
        rexBuilder - Rex builder
        node - Expression to transform
        Returns:
        Equivalent expression with common factors pulled up
      • fixUp

        public static java.util.List<RexNode> fixUp​(RexBuilder rexBuilder,
                                                    java.util.List<RexNode> nodes,
                                                    java.util.List<RelDataType> fieldTypes)
        Fixes up the type of all RexInputRefs in an expression to match differences in nullability.

        Such differences in nullability occur when expressions are moved through outer joins.

        Throws if there any greater inconsistencies of type.

      • types

        public static java.util.List<RelDataType> types​(java.util.List<? extends RexNode> nodes)
        Transforms a list of expressions into a list of their types.
      • removeAll

        public static boolean removeAll​(java.util.List<RexNode> targets,
                                        RexNode e)
        Removes all expressions from a list that are equivalent to a given expression. Returns whether any were removed.
      • eq

        @Deprecated
        public static boolean eq​(RexNode e1,
                                 RexNode e2)
        Deprecated.
        Returns whether two RexNodes are structurally equal.

        This method considers structure, not semantics. 'x < y' is not equivalent to 'y > x'.

      • simplify

        @Deprecated
        public static RexNode simplify​(RexBuilder rexBuilder,
                                       RexNode e,
                                       boolean unknownAsFalse)
        Deprecated.
        Simplifies a boolean expression, using the default executor.

        In particular:

        • simplify(x = 1 AND y = 2 AND NOT x = 1) returns y = 2
        • simplify(x = 1 AND FALSE) returns FALSE

        If the expression is a predicate in a WHERE clause, UNKNOWN values have the same effect as FALSE. In situations like this, specify unknownAsFalse = true, so and we can switch from 3-valued logic to simpler 2-valued logic and make more optimizations.

        Parameters:
        rexBuilder - Rex builder
        e - Expression to simplify
        unknownAsFalse - Whether to convert UNKNOWN values to FALSE
      • simplifyAnds

        @Deprecated
        public static RexNode simplifyAnds​(RexBuilder rexBuilder,
                                           java.lang.Iterable<? extends RexNode> nodes,
                                           boolean unknownAsFalse)
        Deprecated.
      • not

        public static RexNode not​(RexNode e)
        Negates a logical expression by adding or removing a NOT.
      • simplifyAnd

        @Deprecated
        public static RexNode simplifyAnd​(RexBuilder rexBuilder,
                                          RexCall e,
                                          boolean unknownAsFalse)
        Deprecated.
      • simplifyAnd2

        @Deprecated
        public static RexNode simplifyAnd2​(RexBuilder rexBuilder,
                                           java.util.List<RexNode> terms,
                                           java.util.List<RexNode> notTerms)
        Deprecated.
      • simplifyAnd2ForUnknownAsFalse

        @Deprecated
        public static RexNode simplifyAnd2ForUnknownAsFalse​(RexBuilder rexBuilder,
                                                            java.util.List<RexNode> terms,
                                                            java.util.List<RexNode> notTerms)
        Deprecated.
      • simplifyOrs

        @Deprecated
        public static RexNode simplifyOrs​(RexBuilder rexBuilder,
                                          java.util.List<RexNode> terms)
        Deprecated.
      • andNot

        public static RexNode andNot​(RexBuilder rexBuilder,
                                     RexNode e,
                                     RexNode... notTerms)
        Creates the expression e1 AND NOT notTerm1 AND NOT notTerm2 ....
      • andNot

        @Nonnull
        public static RexNode andNot​(RexBuilder rexBuilder,
                                     RexNode e,
                                     java.lang.Iterable<? extends RexNode> notTerms)
        Creates the expression e1 AND NOT notTerm1 AND NOT notTerm2 ....

        Examples:

        • andNot(p) returns "p"
        • andNot(p, n1, n2) returns "p AND NOT n1 AND NOT n2"
        • andNot(x = 10, x = 20, y = 30, x = 30) returns "x = 10 AND NOT (y = 30)"
      • isCasePredicate

        public static boolean isCasePredicate​(RexCall call,
                                              int i)
        Returns whether a given operand of a CASE expression is a predicate.

        A switched case (CASE x WHEN x1 THEN v1 ... ELSE e END) has an even number of arguments and odd-numbered arguments are predicates.

        A condition case (CASE WHEN p1 THEN v1 ... ELSE e END) has an odd number of arguments and even-numbered arguments are predicates, except for the last argument.

      • containsFalse

        private static boolean containsFalse​(java.lang.Iterable<RexNode> nodes)
      • containsTrue

        private static boolean containsTrue​(java.lang.Iterable<RexNode> nodes)
      • containsCorrelation

        public static boolean containsCorrelation​(RexNode condition)
        Returns whether an expression contains a RexCorrelVariable.
      • gatherTableReferences

        public static java.util.Set<RexTableInputRef.RelTableRef> gatherTableReferences​(java.util.List<RexNode> nodes)
        Gather all table references in input expressions.
        Parameters:
        nodes - expressions
        Returns:
        set of table references
      • strings

        public static java.util.List<java.lang.String> strings​(java.util.List<RexNode> list)
        Transforms a list of expressions to the list of digests.