Java源码示例:org.apache.calcite.rel.core.Collect
示例1
public final T traverse(RelNode n) throws Exception {
List<T> inputStreams = new ArrayList<>();
for (RelNode input : n.getInputs()) {
inputStreams.add(traverse(input));
}
if (n instanceof Aggregate) {
return visitAggregate((Aggregate) n, inputStreams);
} else if (n instanceof Calc) {
return visitCalc((Calc) n, inputStreams);
} else if (n instanceof Collect) {
return visitCollect((Collect) n, inputStreams);
} else if (n instanceof Correlate) {
return visitCorrelate((Correlate) n, inputStreams);
} else if (n instanceof Delta) {
return visitDelta((Delta) n, inputStreams);
} else if (n instanceof Exchange) {
return visitExchange((Exchange) n, inputStreams);
} else if (n instanceof Project) {
return visitProject((Project) n, inputStreams);
} else if (n instanceof Filter) {
return visitFilter((Filter) n, inputStreams);
} else if (n instanceof Sample) {
return visitSample((Sample) n, inputStreams);
} else if (n instanceof Sort) {
return visitSort((Sort) n, inputStreams);
} else if (n instanceof TableModify) {
return visitTableModify((TableModify) n, inputStreams);
} else if (n instanceof TableScan) {
return visitTableScan((TableScan) n, inputStreams);
} else if (n instanceof Uncollect) {
return visitUncollect((Uncollect) n, inputStreams);
} else if (n instanceof Window) {
return visitWindow((Window) n, inputStreams);
} else if (n instanceof Join) {
return visitJoin((Join) n, inputStreams);
} else {
return defaultValue(n, inputStreams);
}
}
示例2
public RelNode convert(RelNode rel) {
final Collect collect = (Collect) rel;
final RelTraitSet traitSet =
collect.getTraitSet().replace(EnumerableConvention.INSTANCE);
final RelNode input = collect.getInput();
return new EnumerableCollect(
rel.getCluster(),
traitSet,
convert(input,
input.getTraitSet().replace(EnumerableConvention.INSTANCE)),
collect.getFieldName());
}
示例3
public void rewriteRel(Collect rel) {
rewriteGeneric(rel);
}
示例4
public T visitCollect(Collect collect, List<T> inputStreams) throws Exception {
return defaultValue(collect, inputStreams);
}
示例5
EnumerableCollectRule() {
super(Collect.class, Convention.NONE, EnumerableConvention.INSTANCE,
"EnumerableCollectRule");
}
示例6
public void rewriteRel(Collect rel) {
rewriteGeneric(rel);
}
示例7
public void visit(Collect collect) {
node = new CollectNode(this, collect);
}
示例8
public CollectNode(Compiler compiler, Collect rel) {
super(compiler, rel);
}