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);
}
Aggregations