Search in sources :

Example 1 with OptimizeCollectWhereClauseAccess

use of io.crate.planner.optimizer.rule.OptimizeCollectWhereClauseAccess in project crate by crate.

the class CopyToPlan method optimizeCollect.

private static LogicalPlan optimizeCollect(PlannerContext context, TableStats tableStats, LogicalPlan collect) {
    OptimizeCollectWhereClauseAccess rewriteCollectToGet = new OptimizeCollectWhereClauseAccess();
    Match<Collect> match = rewriteCollectToGet.pattern().accept(collect, Captures.empty());
    if (match.isPresent()) {
        LogicalPlan plan = rewriteCollectToGet.apply(match.value(), match.captures(), tableStats, context.transactionContext(), context.nodeContext());
        return plan == null ? collect : plan;
    }
    return collect;
}
Also used : Collect(io.crate.planner.operators.Collect) LogicalPlan(io.crate.planner.operators.LogicalPlan) OptimizeCollectWhereClauseAccess(io.crate.planner.optimizer.rule.OptimizeCollectWhereClauseAccess)

Aggregations

Collect (io.crate.planner.operators.Collect)1 LogicalPlan (io.crate.planner.operators.LogicalPlan)1 OptimizeCollectWhereClauseAccess (io.crate.planner.optimizer.rule.OptimizeCollectWhereClauseAccess)1