Class PushProjector.RefAndExprConverter

  • All Implemented Interfaces:
    RexVisitor<RexNode>
    Enclosing class:
    PushProjector

    private class PushProjector.RefAndExprConverter
    extends RelOptUtil.RexInputConverter
    Walks an expression tree, replacing input refs with new values to reflect projection and converting special expressions to field references.
    • Field Detail

      • preserveLeft

        private final java.util.List<RexNode> preserveLeft
      • firstLeftRef

        private final int firstLeftRef
      • preserveRight

        private final java.util.List<RexNode> preserveRight
      • firstRightRef

        private final int firstRightRef
    • Constructor Detail

      • RefAndExprConverter

        RefAndExprConverter​(RexBuilder rexBuilder,
                            java.util.List<RelDataTypeField> srcFields,
                            java.util.List<RelDataTypeField> destFields,
                            int[] adjustments,
                            java.util.List<RexNode> preserveLeft,
                            int firstLeftRef,
                            java.util.List<RexNode> preserveRight,
                            int firstRightRef)
    • Method Detail

      • findExprInLists

        private int findExprInLists​(RexNode rex,
                                    java.util.List<RexNode> rexList1,
                                    int adjust1,
                                    java.util.List<RexNode> rexList2,
                                    int adjust2)
        Looks for a matching RexNode from among two lists of RexNodes and returns the offset into the list corresponding to the match, adjusted by an amount, depending on whether the match was from the first or second list.
        Parameters:
        rex - RexNode that is being matched against
        rexList1 - first list of RexNodes
        adjust1 - adjustment if match occurred in first list
        rexList2 - second list of RexNodes
        adjust2 - adjustment if match occurred in the second list
        Returns:
        index in the list corresponding to the matching RexNode; -1 if no match