Class JoinProjectTransposeRule

    • Constructor Detail

      • JoinProjectTransposeRule

        public JoinProjectTransposeRule​(RelOptRuleOperand operand,
                                        java.lang.String description,
                                        boolean includeOuter,
                                        RelBuilderFactory relBuilderFactory)
        Creates a JoinProjectTransposeRule.
      • JoinProjectTransposeRule

        public JoinProjectTransposeRule​(RelOptRuleOperand operand,
                                        java.lang.String description)
        Creates a JoinProjectTransposeRule with default factory.
    • Method Detail

      • hasLeftChild

        protected boolean hasLeftChild​(RelOptRuleCall call)
        Parameters:
        call - RelOptRuleCall
        Returns:
        true if the rule was invoked with a left project child
      • hasRightChild

        protected boolean hasRightChild​(RelOptRuleCall call)
        Parameters:
        call - RelOptRuleCall
        Returns:
        true if the rule was invoked with 2 children
      • getRightChild

        protected Project getRightChild​(RelOptRuleCall call)
        Parameters:
        call - RelOptRuleCall
        Returns:
        LogicalProject corresponding to the right child
      • getProjectChild

        protected RelNode getProjectChild​(RelOptRuleCall call,
                                          Project project,
                                          boolean leftChild)
        Returns the child of the project that will be used as input into the new LogicalJoin once the projects are pulled above the LogicalJoin.
        Parameters:
        call - RelOptRuleCall
        project - project RelNode
        leftChild - true if the project corresponds to the left projection
        Returns:
        child of the project that will be used as input into the new LogicalJoin once the projects are pulled above the LogicalJoin
      • createProjectExprs

        protected void createProjectExprs​(Project projRel,
                                          RelNode joinChild,
                                          int adjustmentAmount,
                                          RexBuilder rexBuilder,
                                          java.util.List<RelDataTypeField> joinChildrenFields,
                                          java.util.List<Pair<RexNode,​java.lang.String>> projects)
        Creates projection expressions corresponding to one of the inputs into the join
        Parameters:
        projRel - the projection input into the join (if it exists)
        joinChild - the child of the projection input (if there is a projection); otherwise, this is the join input
        adjustmentAmount - the amount the expressions need to be shifted by
        rexBuilder - rex builder
        joinChildrenFields - concatenation of the fields from the left and right join inputs (once the projections have been removed)
        projects - Projection expressions & names to be created