use of io.dingodb.exec.operator.SortOperator in project dingo by dingodb.
the class DingoJobVisitor method visit.
@Override
public Collection<Output> visit(@Nonnull DingoSort rel) {
Collection<Output> inputs = dingo(rel.getInput()).accept(this);
List<Output> outputs = new LinkedList<>();
for (Output input : inputs) {
Operator operator = new SortOperator(rel.getCollation().getFieldCollations().stream().map(c -> new SortCollation(c.getFieldIndex(), c.direction, c.nullDirection)).collect(Collectors.toList()), rel.fetch == null ? -1 : RexLiteral.intValue(rel.fetch), rel.offset == null ? 0 : RexLiteral.intValue(rel.offset));
Task task = input.getTask();
operator.setId(idGenerator.get());
task.putOperator(operator);
input.setLink(operator.getInput(0));
operator.getSoleOutput().copyHint(input);
outputs.addAll(operator.getOutputs());
}
return outputs;
}
Aggregations