Search in sources :

Example 6 with Operator

use of io.dingodb.exec.base.Operator in project dingo by dingodb.

the class DingoJobVisitor method visit.

@Override
public Collection<Output> visit(@Nonnull DingoAggregate rel) {
    Collection<Output> inputs = dingo(rel.getInput()).accept(this);
    List<Output> outputs = new LinkedList<>();
    for (Output input : inputs) {
        Operator operator = new AggregateOperator(rel.getKeys(), rel.getAggList());
        Task task = input.getTask();
        operator.setId(idGenerator.get());
        task.putOperator(operator);
        input.setLink(operator.getInput(0));
        outputs.addAll(operator.getOutputs());
    }
    return outputs;
}
Also used : SumUpOperator(io.dingodb.exec.operator.SumUpOperator) AggregateOperator(io.dingodb.exec.operator.AggregateOperator) SortOperator(io.dingodb.exec.operator.SortOperator) RootOperator(io.dingodb.exec.operator.RootOperator) PartScanOperator(io.dingodb.exec.operator.PartScanOperator) SendOperator(io.dingodb.exec.operator.SendOperator) ReceiveOperator(io.dingodb.exec.operator.ReceiveOperator) ProjectOperator(io.dingodb.exec.operator.ProjectOperator) ValuesOperator(io.dingodb.exec.operator.ValuesOperator) PartUpdateOperator(io.dingodb.exec.operator.PartUpdateOperator) ReduceOperator(io.dingodb.exec.operator.ReduceOperator) Operator(io.dingodb.exec.base.Operator) GetByKeysOperator(io.dingodb.exec.operator.GetByKeysOperator) PartitionOperator(io.dingodb.exec.operator.PartitionOperator) PartDeleteOperator(io.dingodb.exec.operator.PartDeleteOperator) PartInsertOperator(io.dingodb.exec.operator.PartInsertOperator) CoalesceOperator(io.dingodb.exec.operator.CoalesceOperator) Task(io.dingodb.exec.base.Task) Output(io.dingodb.exec.base.Output) AggregateOperator(io.dingodb.exec.operator.AggregateOperator) LinkedList(java.util.LinkedList)

Example 7 with Operator

use of io.dingodb.exec.base.Operator in project dingo by dingodb.

the class DingoJobVisitor method visit.

@Override
public Collection<Output> visit(@Nonnull DingoProject rel) {
    Collection<Output> inputs = dingo(rel.getInput()).accept(this);
    List<Output> outputs = new ArrayList<>(inputs.size());
    for (Output input : inputs) {
        Operator operator = new ProjectOperator(RexConverter.toString(rel.getProjects()), TupleSchema.fromRelDataType(rel.getInput().getRowType()));
        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;
}
Also used : SumUpOperator(io.dingodb.exec.operator.SumUpOperator) AggregateOperator(io.dingodb.exec.operator.AggregateOperator) SortOperator(io.dingodb.exec.operator.SortOperator) RootOperator(io.dingodb.exec.operator.RootOperator) PartScanOperator(io.dingodb.exec.operator.PartScanOperator) SendOperator(io.dingodb.exec.operator.SendOperator) ReceiveOperator(io.dingodb.exec.operator.ReceiveOperator) ProjectOperator(io.dingodb.exec.operator.ProjectOperator) ValuesOperator(io.dingodb.exec.operator.ValuesOperator) PartUpdateOperator(io.dingodb.exec.operator.PartUpdateOperator) ReduceOperator(io.dingodb.exec.operator.ReduceOperator) Operator(io.dingodb.exec.base.Operator) GetByKeysOperator(io.dingodb.exec.operator.GetByKeysOperator) PartitionOperator(io.dingodb.exec.operator.PartitionOperator) PartDeleteOperator(io.dingodb.exec.operator.PartDeleteOperator) PartInsertOperator(io.dingodb.exec.operator.PartInsertOperator) CoalesceOperator(io.dingodb.exec.operator.CoalesceOperator) Task(io.dingodb.exec.base.Task) ProjectOperator(io.dingodb.exec.operator.ProjectOperator) Output(io.dingodb.exec.base.Output) ArrayList(java.util.ArrayList)

Aggregations

Operator (io.dingodb.exec.base.Operator)7 RootOperator (io.dingodb.exec.operator.RootOperator)7 Output (io.dingodb.exec.base.Output)6 Task (io.dingodb.exec.base.Task)6 AggregateOperator (io.dingodb.exec.operator.AggregateOperator)6 CoalesceOperator (io.dingodb.exec.operator.CoalesceOperator)6 GetByKeysOperator (io.dingodb.exec.operator.GetByKeysOperator)6 PartDeleteOperator (io.dingodb.exec.operator.PartDeleteOperator)6 PartInsertOperator (io.dingodb.exec.operator.PartInsertOperator)6 PartScanOperator (io.dingodb.exec.operator.PartScanOperator)6 PartUpdateOperator (io.dingodb.exec.operator.PartUpdateOperator)6 PartitionOperator (io.dingodb.exec.operator.PartitionOperator)6 ProjectOperator (io.dingodb.exec.operator.ProjectOperator)6 ReceiveOperator (io.dingodb.exec.operator.ReceiveOperator)6 ReduceOperator (io.dingodb.exec.operator.ReduceOperator)6 SendOperator (io.dingodb.exec.operator.SendOperator)6 SortOperator (io.dingodb.exec.operator.SortOperator)6 SumUpOperator (io.dingodb.exec.operator.SumUpOperator)6 ValuesOperator (io.dingodb.exec.operator.ValuesOperator)6 OutputHint (io.dingodb.exec.base.OutputHint)3