presto-main/src/main/java/io/prestosql/sql/analyzer/Scope.java/Scope/isLocalScope
class Scope:    public boolean isLocalScope(Scope other)
    {
        return findLocally(scope -> scope.getRelationId().equals(other.getRelationId())).isPresent();
    }