presto-main/src/main/java/io/prestosql/sql/planner/sanity/ValidateDependenciesChecker.java/Visitor/visitCorrelatedJoin
class Visitor:        @Override
        public Void visitCorrelatedJoin(CorrelatedJoinNode node, Set<Symbol> boundSymbols)
        {
            Set<Symbol> subqueryCorrelation = ImmutableSet.<Symbol>builder()
                    .addAll(boundSymbols)
                    .addAll(node.getCorrelation())
                    .build();

            node.getInput().accept(this, boundSymbols); // visit child
            node.getSubquery().accept(this, subqueryCorrelation); // visit child

            checkDependencies(
                    node.getInput().getOutputSymbols(),
                    node.getCorrelation(),
                    "Correlated JOIN input must provide all the necessary correlation symbols for subquery");
            checkDependencies(
                    SymbolsExtractor.extractUnique(node.getSubquery()),
                    node.getCorrelation(),
                    "not all correlated JOIN correlation symbols are used in subquery");

            Set<Symbol> inputs = ImmutableSet.<Symbol>builder()
                    .addAll(createInputs(node.getInput(), boundSymbols))
                    .addAll(createInputs(node.getSubquery(), boundSymbols))
                    .build();

            Set<Symbol> filterSymbols = SymbolsExtractor.extractUnique(node.getFilter());

            checkDependencies(inputs, filterSymbols, "filter symbols (%s) not in sources (%s)", filterSymbols, inputs);

            return null;
        }