public static boolean hasReferencesToScope(Node node, Analysis analysis, Scope scope) {
    return getReferencesToScope(node, analysis, scope).findAny().isPresent();
  }
Extract expressions that are references to a given scope.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/ScopeReferenceExtractor.java