private static boolean isReferenceToScope(
      Expression node, Scope scope, Map<NodeRef<Expression>, ResolvedField> columnReferences) {
    ResolvedField field = columnReferences.get(NodeRef.of(node));
    requireNonNull(field, () -> "No Field for " + node);
    return isFieldFromScope(field.getFieldId(), scope);
  }
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