new UnionRel( cluster, unionInputs,
} else { bb.setRoot( new UnionRel( cluster, unionRels,
return new UnionRel( cluster, ImmutableList.of(left, right),
public UnionRel copy( RelTraitSet traitSet, List<RelNode> inputs, boolean all) { assert traitSet.containsIfApplicable(Convention.NONE); return new UnionRel( getCluster(), inputs, all); } }
public UnionRel copy( RelTraitSet traitSet, List<RelNode> inputs, boolean all) { assert traitSet.containsIfApplicable(Convention.NONE); return new UnionRel( getCluster(), inputs, all); }
default: newRel = new UnionRel( union.getCluster(), newChildRels,
public void onMatch(RelOptRuleCall call) { UnionRel union = call.rel(0); if (union.all) { return; // nothing to do } UnionRel unionAll = new UnionRel( union.getCluster(), union.getInputs(), true); call.transformTo(RelOptUtil.createDistinctRel(unionAll)); } }
default: newRel = new UnionRel( union.getCluster(), newChildRels,
public void onMatch(RelOptRuleCall call) { UnionRel union = call.rel(0); if (union.all) { return; // nothing to do } UnionRel unionAll = new UnionRel( union.getCluster(), union.getInputs(), true); call.transformTo(RelOptUtil.createDistinctRel(unionAll)); } }
- 1; UnionRel newUnionRel = new UnionRel( topUnionRel.getCluster(), unionInputs,
- 1; UnionRel newUnionRel = new UnionRel( topUnionRel.getCluster(), unionInputs,
} else { bb.setRoot( new UnionRel( cluster, unionRels,
} else { bb.setRoot( new UnionRel( cluster, unionRels,
return new UnionRel( cluster, ImmutableList.of(left, right),
return new UnionRel( cluster, Arrays.asList(left, right),
Collections.<String>emptySet())); UnionRel newUnionRel = new UnionRel(cluster, newUnionInputs, true); call.transformTo(newUnionRel);
new UnionRel( unionRel.getCluster(), unionInputs,
private static RelNode fromMutable(MutableRel node) { switch (node.type) { case SCAN: case VALUES: return ((MutableLeafRel) node).rel; case PROJECT: final MutableProject project = (MutableProject) node; return new ProjectRel(node.cluster, node.cluster.traitSetOf(RelCollationImpl.EMPTY), fromMutable(project.input), project.projects, project.rowType, ProjectRelBase.Flags.BOXED); case FILTER: final MutableFilter filter = (MutableFilter) node; return new FilterRel(node.cluster, fromMutable(filter.input), filter.condition); case AGGREGATE: final MutableAggregate aggregate = (MutableAggregate) node; return new AggregateRel(node.cluster, fromMutable(aggregate.input), aggregate.groupSet, aggregate.aggCalls); case SORT: final MutableSort sort = (MutableSort) node; return new SortRel(node.cluster, node.cluster.traitSetOf(sort.collation), fromMutable(sort.input), sort.collation, sort.offset, sort.fetch); case UNION: final MutableUnion union = (MutableUnion) node; return new UnionRel(union.cluster, fromMutables(union.inputs), union.all); default: throw new AssertionError(node.deep()); } }
new UnionRel( unionRel.getCluster(), unionInputs,
UnionRel newUnionRel = new UnionRel(cluster, newUnionInputs, true);