presto-main/src/main/java/io/prestosql/sql/planner/sanity/ValidateDependenciesChecker.java/ValidateDependenciesChecker/visitStatisticsWriterNode
class ValidateDependenciesChecker:        @Override
        public Void visitStatisticsWriterNode(StatisticsWriterNode node, Set<Symbol> boundSymbols)
        {
            node.getSource().accept(this, boundSymbols); // visit child

            StatisticAggregationsDescriptor<Symbol> descriptor = node.getDescriptor();
            Set<Symbol> dependencies = ImmutableSet.<Symbol>builder()
                    .addAll(descriptor.getGrouping().values())
                    .addAll(descriptor.getColumnStatistics().values())
                    .addAll(descriptor.getTableStatistics().values())
                    .build();
            List<Symbol> outputSymbols = node.getSource().getOutputSymbols();
            checkDependencies(dependencies, dependencies, "Invalid node. Dependencies (%s) not in source plan output (%s)", dependencies, outputSymbols);
            return null;
        }