org.eigenbase.rel.rules
Class PushProjector.RefAndExprConverter

java.lang.Object
  extended by org.eigenbase.rex.RexShuttle
      extended by org.eigenbase.relopt.RelOptUtil.RexInputConverter
          extended by org.eigenbase.rel.rules.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 Summary
private  int firstLeftRef
           
private  int firstRightRef
           
private  List<RexNode> preserveLeft
           
private  List<RexNode> preserveRight
           
 
Fields inherited from class org.eigenbase.relopt.RelOptUtil.RexInputConverter
destFields, rexBuilder
 
Constructor Summary
PushProjector.RefAndExprConverter(RexBuilder rexBuilder, RelDataTypeField[] srcFields, RelDataTypeField[] destFields, int[] adjustments, List<RexNode> preserveLeft, int firstLeftRef, List<RexNode> preserveRight, int firstRightRef)
           
 
Method Summary
private  int findExprInList(RexNode rex, List<RexNode> rexList)
           
private  int findExprInLists(RexNode rex, List<RexNode> rexList1, int adjust1, 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.
 RexNode visitCall(RexCall call)
           
 
Methods inherited from class org.eigenbase.relopt.RelOptUtil.RexInputConverter
visitInputRef
 
Methods inherited from class org.eigenbase.rex.RexShuttle
apply, apply, visitArray, visitCorrelVariable, visitDynamicParam, visitFieldAccess, visitLiteral, visitLocalRef, visitOver, visitRangeRef, visitWindow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

preserveLeft

private final List<RexNode> preserveLeft

firstLeftRef

private final int firstLeftRef

preserveRight

private final List<RexNode> preserveRight

firstRightRef

private final int firstRightRef
Constructor Detail

PushProjector.RefAndExprConverter

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

visitCall

public RexNode visitCall(RexCall call)
Specified by:
visitCall in interface RexVisitor<RexNode>
Overrides:
visitCall in class RexShuttle

findExprInLists

private int findExprInLists(RexNode rex,
                            List<RexNode> rexList1,
                            int adjust1,
                            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

findExprInList

private int findExprInList(RexNode rex,
                           List<RexNode> rexList)