@Override public PlanNode optimize( PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { return SimplePlanRewriter.rewriteWith( new Rewriter(metadata, session, symbolAllocator, idAllocator), plan); }
@Override public PlanNode optimize( PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { requireNonNull(plan, "plan is null"); requireNonNull(session, "session is null"); requireNonNull(types, "types is null"); requireNonNull(symbolAllocator, "symbolAllocator is null"); requireNonNull(idAllocator, "idAllocator is null"); return SimplePlanRewriter.rewriteWith(new Rewriter(), plan); }
public static Optional<PlanNode> rewriteWithIndex( PlanNode planNode, Set<Symbol> lookupSymbols, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator, Metadata metadata, Session session) { AtomicBoolean success = new AtomicBoolean(); IndexSourceRewriter indexSourceRewriter = new IndexSourceRewriter(symbolAllocator, idAllocator, metadata, session); PlanNode rewritten = SimplePlanRewriter.rewriteWith( indexSourceRewriter, planNode, new Context(lookupSymbols, success)); if (success.get()) { return Optional.of(rewritten); } return Optional.empty(); }