use of io.dingodb.exec.operator.PartitionOperator in project dingo by dingodb.
the class DingoJobVisitor method visit.
@Override
public Collection<Output> visit(@Nonnull DingoPartition rel) {
Collection<Output> inputs = dingo(rel.getInput()).accept(this);
String tableName = getSimpleName(rel.getTable());
List<Output> outputs = new LinkedList<>();
final Map<String, Location> partLocations = Services.META.getPartLocations(tableName);
final TableDefinition td = Services.META.getTableDefinition(tableName);
final PartitionStrategy ps = new SimpleHashStrategy(partLocations.size());
for (Output input : inputs) {
Task task = input.getTask();
PartitionOperator operator = new PartitionOperator(ps, td.getKeyMapping());
operator.setId(idGenerator.get());
operator.createOutputs(tableName, partLocations);
task.putOperator(operator);
input.setLink(operator.getInput(0));
outputs.addAll(operator.getOutputs());
}
return outputs;
}
Aggregations