Class JoinCommuteRule


  • public class JoinCommuteRule
    extends RelOptRule
    Planner rule that permutes the inputs to a Join.

    Permutation of outer joins can be turned on/off by specifying the swapOuter flag in the constructor.

    To preserve the order of columns in the output row, the rule adds a Project.

    • Field Detail

      • INSTANCE

        public static final JoinCommuteRule INSTANCE
        Instance of the rule that only swaps inner joins.
      • SWAP_OUTER

        public static final JoinCommuteRule SWAP_OUTER
        Instance of the rule that swaps outer joins as well as inner joins.
      • swapOuter

        private final boolean swapOuter
    • Constructor Detail

      • JoinCommuteRule

        public JoinCommuteRule​(java.lang.Class<? extends Join> clazz,
                               RelBuilderFactory relBuilderFactory,
                               boolean swapOuter)
        Creates a JoinCommuteRule.
      • JoinCommuteRule

        private JoinCommuteRule​(boolean swapOuter)
      • JoinCommuteRule

        @Deprecated
        public JoinCommuteRule​(java.lang.Class<? extends Join> clazz,
                               RelFactories.ProjectFactory projectFactory,
                               boolean swapOuter)
        Deprecated.
    • Method Detail

      • swap

        @Deprecated
        public static RelNode swap​(Join join)
        Deprecated.
      • swap

        @Deprecated
        public static RelNode swap​(Join join,
                                   boolean swapOuterJoins)
        Deprecated.
      • swap

        public static RelNode swap​(Join join,
                                   boolean swapOuterJoins,
                                   RelBuilder relBuilder)
        Returns a relational expression with the inputs switched round. Does not modify join. Returns null if the join cannot be swapped (for example, because it is an outer join).
        Parameters:
        join - join to be swapped
        swapOuterJoins - whether outer joins should be swapped
        relBuilder - Builder for relational expressions
        Returns:
        swapped join if swapping possible; else null