presto-main/src/main/java/io/prestosql/sql/planner/optimizations/WindowNodeUtil.java/WindowNodeUtil/dependsOn
class WindowNodeUtil:    public static boolean dependsOn(WindowNode parent, WindowNode child)
    {
        return parent.getPartitionBy().stream().anyMatch(child.getCreatedSymbols()::contains)
                || (parent.getOrderingScheme().isPresent() && parent.getOrderingScheme().get().getOrderBy().stream().anyMatch(child.getCreatedSymbols()::contains))
                || parent.getWindowFunctions().values().stream()
                .map(SymbolsExtractor::extractUnique)
                .flatMap(Collection::stream)
                .anyMatch(child.getCreatedSymbols()::contains);
    }