@Override
    protected Boolean visitIdentifier(Identifier node, Void context) {
      //      if (analysis.getLambdaArgumentReferences().containsKey(NodeRef.of(node))) {
      //        return true;
      //      }

      if (!hasReferencesToScope(node, analysis, sourceScope)) {
        // reference to outer scope is group-invariant
        return true;
      }

      return isGroupingKey(node);
    }
visitor returns true if all expressions are constant with respect to the group.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/AggregationAnalyzer.java