presto-main/src/main/java/io/prestosql/sql/analyzer/ScopeReferenceExtractor.java/ScopeReferenceExtractor/getReferencesToScope
class ScopeReferenceExtractor:    public static Stream<Expression> getReferencesToScope(Node node, Analysis analysis, Scope scope)
    {
        Map<NodeRef<Expression>, FieldId> columnReferences = analysis.getColumnReferenceFields();

        return AstUtils.preOrder(node)
                .filter(Expression.class::isInstance)
                .map(Expression.class::cast)
                .filter(expression -> columnReferences.containsKey(NodeRef.of(expression)))
                .filter(expression -> isReferenceToScope(expression, scope, columnReferences));
    }