Search in sources :

Example 1 with InputRow

use of io.crate.operation.InputRow in project crate by crate.

the class SingleRowSource method getCollector.

@Override
public CrateCollector getCollector(CollectPhase phase, BatchConsumer consumer, JobCollectContext jobCollectContext) {
    RoutedCollectPhase collectPhase = (RoutedCollectPhase) phase;
    collectPhase = collectPhase.normalize(clusterNormalizer, null);
    if (collectPhase.whereClause().noMatch()) {
        return RowsCollector.empty(consumer);
    }
    assert !collectPhase.whereClause().hasQuery() : "WhereClause should have been normalized to either MATCH_ALL or NO_MATCH";
    InputFactory inputFactory = new InputFactory(functions);
    InputFactory.Context<CollectExpression<Row, ?>> ctx = inputFactory.ctxForInputColumns(collectPhase.toCollect());
    return RowsCollector.single(new InputRow(ctx.topLevelInputs()), consumer);
}
Also used : InputFactory(io.crate.operation.InputFactory) InputRow(io.crate.operation.InputRow) CollectExpression(io.crate.operation.collect.CollectExpression) RoutedCollectPhase(io.crate.planner.node.dql.RoutedCollectPhase)

Aggregations

InputFactory (io.crate.operation.InputFactory)1 InputRow (io.crate.operation.InputRow)1 CollectExpression (io.crate.operation.collect.CollectExpression)1 RoutedCollectPhase (io.crate.planner.node.dql.RoutedCollectPhase)1