Search in sources :

Example 1 with TableFunctionRelation

use of io.crate.analyze.relations.TableFunctionRelation in project crate by crate.

the class RoutedCollectPhase method forQueriedTable.

public static RoutedCollectPhase forQueriedTable(Planner.Context plannerContext, QueriedTableRelation table, List<Symbol> toCollect, List<Projection> projections) {
    TableInfo tableInfo = table.tableRelation().tableInfo();
    WhereClause where = table.querySpec().where();
    if (table.tableRelation() instanceof TableFunctionRelation) {
        TableFunctionRelation tableFunctionRelation = (TableFunctionRelation) table.tableRelation();
        plannerContext.normalizer().normalizeInplace(tableFunctionRelation.function().arguments(), plannerContext.transactionContext());
        return new TableFunctionCollectPhase(plannerContext.jobId(), plannerContext.nextExecutionPhaseId(), plannerContext.allocateRouting(tableInfo, where, null), tableFunctionRelation, projections, toCollect, where);
    }
    return new RoutedCollectPhase(plannerContext.jobId(), plannerContext.nextExecutionPhaseId(), "collect", plannerContext.allocateRouting(tableInfo, where, null), tableInfo.rowGranularity(), toCollect, projections, where, DistributionInfo.DEFAULT_BROADCAST);
}
Also used : WhereClause(io.crate.analyze.WhereClause) TableInfo(io.crate.metadata.table.TableInfo) TableFunctionRelation(io.crate.analyze.relations.TableFunctionRelation)

Aggregations

WhereClause (io.crate.analyze.WhereClause)1 TableFunctionRelation (io.crate.analyze.relations.TableFunctionRelation)1 TableInfo (io.crate.metadata.table.TableInfo)1