public RexNode visitCall(final RexCall call) { boolean[] update = {false}; List<RexNode> clonedOperands = visitList(call.operands, update); if (update[0]) { // REVIEW jvs 8-Mar-2005: This doesn't take into account // the fact that a rewrite may have changed the result type. // To do that, we would need to take a RexBuilder and // watch out for special operators like CAST and NEW where // the type is embedded in the original call. return new RexCall( call.getType(), call.getOperator(), clonedOperands); } else { return call; } }
public RexNode visitCall(final RexCall call) { boolean [] update = { false }; List<RexNode> clonedOperands = visitList(call.operands, update); if (update[0]) { // REVIEW jvs 8-Mar-2005: This doesn't take into account // the fact that a rewrite may have changed the result type. // To do that, we would need to take a RexBuilder and // watch out for special operators like CAST and NEW where // the type is embedded in the original call. return new RexCall( call.getType(), call.getOperator(), clonedOperands); } else { return call; } }
public RexWindow visitWindow(RexWindow window) { boolean [] update = { false }; List<RexFieldCollation> clonedOrderKeys = visitFieldCollations(window.orderKeys, update); List<RexNode> clonedPartitionKeys = visitList(window.partitionKeys, update); if (update[0]) { return new RexWindow( clonedPartitionKeys, clonedOrderKeys, window.getLowerBound(), window.getUpperBound(), window.isRows()); } else { return window; } }
public RexNode visitOver(RexOver over) { boolean[] update = {false}; List<RexNode> clonedOperands = visitList(over.operands, update); RexWindow window = visitWindow(over.getWindow()); if (update[0] || (window != over.getWindow())) { // REVIEW jvs 8-Mar-2005: This doesn't take into account // the fact that a rewrite may have changed the result type. // To do that, we would need to take a RexBuilder and // watch out for special operators like CAST and NEW where // the type is embedded in the original call. return new RexOver( over.getType(), over.getAggOperator(), clonedOperands, window); } else { return over; } }
public RexNode visitOver(RexOver over) { boolean [] update = { false }; List<RexNode> clonedOperands = visitList(over.operands, update); RexWindow window = visitWindow(over.getWindow()); if (update[0] || (window != over.getWindow())) { // REVIEW jvs 8-Mar-2005: This doesn't take into account // the fact that a rewrite may have changed the result type. // To do that, we would need to take a RexBuilder and // watch out for special operators like CAST and NEW where // the type is embedded in the original call. return new RexOver( over.getType(), over.getAggOperator(), clonedOperands, window); } else { return over; } }
public RexWindow visitWindow(RexWindow window) { boolean[] update = {false}; List<RexFieldCollation> clonedOrderKeys = visitFieldCollations(window.orderKeys, update); List<RexNode> clonedPartitionKeys = visitList(window.partitionKeys, update); RexWindowBound lowerBound = window.getLowerBound().accept(this); RexWindowBound upperBound = window.getUpperBound().accept(this); if (update[0] || (lowerBound != window.getLowerBound() && lowerBound != null) || (upperBound != window.getUpperBound() && upperBound != null)) { return new RexWindow( clonedPartitionKeys, clonedOrderKeys, lowerBound, upperBound, window.isRows()); } else { return window; } }