Class ValuesReduceRule

  • public abstract class ValuesReduceRule
    extends RelOptRule
    Planner rule that folds projections and filters into an underlying LogicalValues.

    Returns a simplified Values, perhaps containing zero tuples if all rows are filtered away.

    For example,

    select a - b from (values (1, 2), (3, 5), (7, 11)) as t (a, b) where a + b > 4


    select x from (values (-2), (-4))

    Ignores an empty Values; this is better dealt with by PruneEmptyRules.

    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER

        public static final ValuesReduceRule FILTER_INSTANCE
        Instance of this rule that applies to the pattern Filter(Values).

        public static final ValuesReduceRule PROJECT_INSTANCE
        Instance of this rule that applies to the pattern Project(Values).

        public static final ValuesReduceRule PROJECT_FILTER_INSTANCE
        Singleton instance of this rule that applies to the pattern Project(Filter(Values)).
    • Constructor Detail

      • ValuesReduceRule

        public ValuesReduceRule​(RelOptRuleOperand operand,
                                RelBuilderFactory relBuilderFactory,
                                java.lang.String desc)
        Creates a ValuesReduceRule.
        operand - Class of rels to which this rule should apply
        relBuilderFactory - Builder for relational expressions
        desc - Description, or null to guess description