presto-main/src/main/java/io/prestosql/sql/planner/SortExpressionExtractor.java/SortExpressionExtractor/asBuildSymbolReference
class SortExpressionExtractor:    private static Optional<SymbolReference> asBuildSymbolReference(Set<Symbol> buildLayout, Expression expression)
    {
        // Currently only we support only symbol as sort expression on build side
        if (expression instanceof SymbolReference) {
            SymbolReference symbolReference = (SymbolReference) expression;
            if (buildLayout.contains(new Symbol(symbolReference.getName()))) {
                return Optional.of(symbolReference);
            }
        }
        return Optional.empty();
    }