JackieTien97 commented on code in PR #17380:
URL: https://github.com/apache/iotdb/pull/17380#discussion_r3004266027


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/analyzer/StatementAnalyzer.java:
##########
@@ -2718,6 +2724,69 @@ private Analysis.GroupingSetAnalysis analyzeGroupBy(
       return result;
     }
 
+    private Analysis.GroupingSetAnalysis analyzeGroupByAll(
+        QuerySpecification node, Scope scope, List<Expression> 
outputExpressions) {
+      ImmutableList.Builder<List<Set<FieldId>>> sets = ImmutableList.builder();
+      ImmutableList.Builder<Expression> complexExpressions = 
ImmutableList.builder();
+      ImmutableList.Builder<Expression> groupingExpressions = 
ImmutableList.builder();
+      FunctionCall gapFillColumn = null;
+      ImmutableList.Builder<Expression> gapFillGroupingExpressions = 
ImmutableList.builder();
+
+      for (Expression outputExpression : outputExpressions) {
+        List<FunctionCall> aggregates =
+            extractAggregateFunctions(ImmutableList.of(outputExpression));
+        List<FunctionCall> windowFunctions =
+            extractWindowFunctions(ImmutableList.of(outputExpression));
+        if (!aggregates.isEmpty() || !windowFunctions.isEmpty()) {
+          continue;
+        }

Review Comment:
   what about `select s1+avg(s2) from t1 group by all`? You can try what will 
duckdb deal with this sql, and IMO, `group by all` should equal to `group by 
s1` which means group by all should include all non-agg expression in select 
including sub-expression inside one select item.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to