presto-main/src/main/java/io/prestosql/sql/planner/optimizations/IndexJoinOptimizer.java/IndexJoinOptimizer/visitIndexJoin
class IndexJoinOptimizer:        @Override
        public PlanNode visitIndexJoin(IndexJoinNode node, RewriteContext<Context> context)
        {
            // Lookup symbols can only be passed through the probe side of an index join
            Set<Symbol> probeLookupSymbols = context.get().getLookupSymbols().stream()
                    .filter(node.getProbeSource().getOutputSymbols()::contains)
                    .collect(toImmutableSet());

            if (probeLookupSymbols.isEmpty()) {
                return node;
            }

            PlanNode rewrittenProbeSource = context.rewrite(node.getProbeSource(), new Context(probeLookupSymbols, context.get().getSuccess()));

            PlanNode source = node;
            if (rewrittenProbeSource != node.getProbeSource()) {
                source = new IndexJoinNode(node.getId(), node.getType(), rewrittenProbeSource, node.getIndexSource(), node.getCriteria(), node.getProbeHashSymbol(), node.getIndexHashSymbol());
            }

            return source;
        }