presto-main/src/main/java/io/prestosql/sql/planner/optimizations/StreamPreferredProperties.java/StreamPreferredProperties/constrainTo
class StreamPreferredProperties:    public StreamPreferredProperties constrainTo(Iterable<Symbol> symbols)
    {
        if (!partitioningColumns.isPresent()) {
            return this;
        }

        ImmutableSet<Symbol> availableSymbols = ImmutableSet.copyOf(symbols);
        if (exactColumnOrder) {
            if (availableSymbols.containsAll(partitioningColumns.get())) {
                return this;
            }
            return any();
        }

        List<Symbol> common = partitioningColumns.get().stream()
                .filter(availableSymbols::contains)
                .collect(toImmutableList());
        if (common.isEmpty()) {
            return any();
        }
        return new StreamPreferredProperties(distribution, Optional.of(common), false);
    }