You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2026/03/19 14:04:39 UTC
Re: [PR] [SPARK-56035] [SQL] Introduce `AggregateValidator` for single-pass resolver `Aggregate` validation [spark]
cloud-fan commented on code in PR #54866:
URL: https://github.com/apache/spark/pull/54866#discussion_r2960296577
##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala:
##########
@@ -5100,6 +5100,13 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
checkAnswer(sql("SELECT 1L UNION SELECT 1"), Row(1L))
}
}
+
+ test("SPARK-56035: Introduce `AggregateValidator` for single-pass `Aggregate` validation ") {
+ sql("SELECT col1 + rand() FROM VALUES(1) GROUP BY ALL")
+ sql("SELECT col1 + rand() FROM VALUES(1) GROUP BY 1")
+ sql("SELECT rand() FROM VALUES(1) GROUP BY ALL")
+ sql("SELECT col1 - rand() FROM VALUES(1) GROUP BY ALL")
+ }
Review Comment:
These tests run through the iterative analyzer (single-pass resolver is disabled by default). In the iterative path, `PullOutNondeterministic` runs before `CheckAnalysis`, so these queries already succeed without this PR's changes — the `AggregationValidator` code path is not exercised.
Consider adding tests in `AggregateResolverSuite` (which directly uses `ResolverRunner`) to cover the single-pass path.
Also: the test name says "AggregateValidator" but the class is `AggregationValidator`, and there's a trailing space:
```suggestion
test("SPARK-56035: Introduce `AggregationValidator` for single-pass `Aggregate` validation") {
sql("SELECT col1 + rand() FROM VALUES(1) GROUP BY ALL")
sql("SELECT col1 + rand() FROM VALUES(1) GROUP BY 1")
sql("SELECT rand() FROM VALUES(1) GROUP BY ALL")
sql("SELECT col1 - rand() FROM VALUES(1) GROUP BY ALL")
}
```
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org