Class FilterJoinRule

    • Field Detail


        public static final FilterJoinRule.Predicate TRUE_PREDICATE
        Predicate that always returns true. With this predicate, every filter will be pushed into the ON clause.

        private static final FilterJoinRule.Predicate NOT_ENUMERABLE
        Predicate that returns true if the join is not Enumerable convention, will be replaced by TRUE_PREDICATE once enumerable join supports non-equi join.

        public static final FilterJoinRule FILTER_ON_JOIN
        Rule that pushes predicates from a Filter into the Join below them.

        public static final FilterJoinRule DUMB_FILTER_ON_JOIN
        Dumber version of FILTER_ON_JOIN. Not intended for production use, but keeps some tests working for which FILTER_ON_JOIN is too smart.
      • JOIN

        public static final FilterJoinRule JOIN
        Rule that pushes predicates in a Join into the inputs to the join.
      • smart

        private final boolean smart
        Whether to try to strengthen join-type.
      • predicate

        private final FilterJoinRule.Predicate predicate
        Predicate that returns whether a filter is valid in the ON clause of a join for this particular kind of join. If not, Calcite will push it back to above the join.
    • Method Detail

      • getConjunctions

        private java.util.List<RexNode> getConjunctions​(Filter filter)
        Get conjunctions of filter's condition but with collapsed IS NOT DISTINCT FROM expressions if needed.
        filter - filter containing condition
        condition conjunctions with collapsed IS NOT DISTINCT FROM expressions if any
        See Also:
      • validateJoinFilters

        protected void validateJoinFilters​(java.util.List<RexNode> aboveFilters,
                                           java.util.List<RexNode> joinFilters,
                                           Join join,
                                           JoinRelType joinType)
        Validates that target execution framework can satisfy join filters.

        If the join filter cannot be satisfied (for example, if it is l.c1 > r.c2 and the join only supports equi-join), removes the filter from joinFilters and adds it to aboveFilters.

        The default implementation does nothing; i.e. the join can handle all conditions.

        aboveFilters - Filter above Join
        joinFilters - Filters in join condition
        join - Join
        joinType - JoinRelType could be different from type in Join due to outer join simplification.