public RexNode visitCall(RexCall call) { final RexNode expr = super.visitCall(call); return registerInternal(expr, false); }
/** * Applies this shuttle to each expression in a list and returns the * resulting list. Does not modify the initial list. */ public final <T extends RexNode> List<T> apply(List<T> exprList) { final List<T> list2 = new ArrayList<T>(exprList); if (mutate(list2)) { return list2; } else { return exprList; } }
public RexNode visitCorrelVariable(RexCorrelVariable variable) { final RexNode expr = super.visitCorrelVariable(variable); return registerInternal(expr, false); } }
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 visitLiteral(RexLiteral literal) { final RexNode expr = super.visitLiteral(literal); return registerInternal(expr, false); }
public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { final RexNode expr = super.visitDynamicParam(dynamicParam); return registerInternal(expr, false); }
public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { final RexNode expr = super.visitFieldAccess(fieldAccess); return registerInternal(expr, false); }
public RexNode visitOver(RexOver over) { final RexNode expr = super.visitOver(over); return registerInternal(expr, false); }
public UnifyResult apply(UnifyRuleCall call) { final MutableProject target = (MutableProject) call.target; final MutableProject query = (MutableProject) call.query; final RexShuttle shuttle = getRexShuttle(target); final List<RexNode> newProjects; try { newProjects = shuttle.apply(query.getProjects()); } catch (MatchFailed e) { return null; } final MutableProject newProject = MutableProject.of( query.getRowType(), target, newProjects); final MutableRel newProject2 = MutableRels.strip(newProject); return call.result(newProject2); } }
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); 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; } }
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 visitLiteral(RexLiteral literal) { final RexNode expr = super.visitLiteral(literal); return registerInternal(expr, false); }
public RexNode visitDynamicParam(RexDynamicParam dynamicParam) { final RexNode expr = super.visitDynamicParam(dynamicParam); return registerInternal(expr, false); }
public RexNode visitFieldAccess(RexFieldAccess fieldAccess) { final RexNode expr = super.visitFieldAccess(fieldAccess); return registerInternal(expr, false); }
public RexNode visitOver(RexOver over) { final RexNode expr = super.visitOver(over); return registerInternal(expr, false); }
public UnifyResult apply(UnifyIn<ProjectRel, ProjectRel> in) { final RexShuttle shuttle = getRexShuttle(in.target); final List<RexNode> newProjects; try { newProjects = shuttle.apply(in.query.getProjects()); } catch (MatchFailed e) { return null; } final ProjectRel newProject = new ProjectRel( in.target.getCluster(), in.target, newProjects, in.query.getRowType(), in.query.getFlags(), in.query.getCollationList()); final RelNode newProject2 = RemoveTrivialProjectRule.strip(newProject); return in.result(newProject2); } }
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(RexCall call) { final RexNode expr = super.visitCall(call); return registerInternal(expr, false); }