public RelNode copy(RelTraitSet traitSet, List<RelNode> inputs) { // Note that empty set equals empty set, so relational expressions // with zero inputs do not generally need to implement their own copy // method. if (getInputs().equals(inputs) && traitSet == getTraitSet()) { return this; } throw new AssertionError("Relational expression should override copy. " + "Class=[" + getClass() + "]; traits=[" + getTraitSet() + "]; desired traits=[" + traitSet + "]"); }
public RelNode copy(RelTraitSet traitSet, List<RelNode> inputs) { // Note that empty set equals empty set, so relational expressions // with zero inputs do not generally need to implement their own copy // method. if (getInputs().equals(inputs) && traitSet == getTraitSet()) { return this; } throw new AssertionError("Relational expression should override copy. " + "Class=[" + getClass() + "]; traits=[" + getTraitSet() + "]; desired traits=[" + traitSet + "]"); }
public RelNode onRegister(RelOptPlanner planner) { List<RelNode> oldInputs = getInputs(); List<RelNode> inputs = new ArrayList<>(oldInputs.size()); for (final RelNode input : oldInputs) { RelNode e = planner.ensureRegistered(input, null); if (e != input) { // TODO: change 'equal' to 'eq', which is stronger. assert RelOptUtil.equal( "rowtype of rel before registration", input.getRowType(), "rowtype of rel after registration", e.getRowType(), Litmus.THROW); } inputs.add(e); } RelNode r = this; if (!Util.equalShallow(oldInputs, inputs)) { r = copy(getTraitSet(), inputs); } r.recomputeDigest(); assert r.isValid(Litmus.THROW, null); return r; }
public RelNode onRegister(RelOptPlanner planner) { List<RelNode> oldInputs = getInputs(); List<RelNode> inputs = new ArrayList<>(oldInputs.size()); for (final RelNode input : oldInputs) { RelNode e = planner.ensureRegistered(input, null); if (e != input) { // TODO: change 'equal' to 'eq', which is stronger. assert RelOptUtil.equal( "rowtype of rel before registration", input.getRowType(), "rowtype of rel after registration", e.getRowType(), Litmus.THROW); } inputs.add(e); } RelNode r = this; if (!Util.equalShallow(oldInputs, inputs)) { r = copy(getTraitSet(), inputs); } r.recomputeDigest(); assert r.isValid(Litmus.THROW, null); return r; }