presto-main/src/main/java/io/prestosql/sql/planner/sanity/ValidateDependenciesChecker.java/ValidateDependenciesChecker/visitUnnest
class ValidateDependenciesChecker:        @Override
        public Void visitUnnest(UnnestNode node, Set<Symbol> boundSymbols)
        {
            PlanNode source = node.getSource();
            source.accept(this, boundSymbols);

            ImmutableSet.Builder<Symbol> required = ImmutableSet.<Symbol>builder()
                    .addAll(node.getReplicateSymbols())
                    .addAll(node.getUnnestSymbols().keySet());
            ImmutableSet.Builder<Symbol> unnestedSymbols = ImmutableSet.builder();
            for (List<Symbol> symbols : node.getUnnestSymbols().values()) {
                unnestedSymbols.addAll(symbols);
            }
            Set<Symbol> expectedFilterSymbols = Sets.difference(SymbolsExtractor.extractUnique(node.getFilter().orElse(TRUE_LITERAL)), unnestedSymbols.build());
            required.addAll(expectedFilterSymbols);
            checkDependencies(source.getOutputSymbols(), required.build(), "Invalid node. Dependencies (%s) not in source plan output (%s)", required, source.getOutputSymbols());

            return null;
        }