You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/29 13:07:56 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #31983: [SPARK-34882][SQL] Replace if with filter clause in RewriteDistinctAggregates

HyukjinKwon commented on a change in pull request #31983:
URL: https://github.com/apache/spark/pull/31983#discussion_r603278300



##########
File path: sql/core/src/test/resources/sql-tests/inputs/group-by.sql
##########
@@ -179,3 +179,11 @@ SELECT count(*) FROM test_agg WHERE k = 1 or k = 2 or count(*) + 1L > 1L or max(
 
 -- Aggregate with multiple distinct decimal columns
 SELECT AVG(DISTINCT decimal_col), SUM(DISTINCT decimal_col) FROM VALUES (CAST(1 AS DECIMAL(9, 0))) t(decimal_col);
+
+-- SPARK-34882: Aggregate with multiple distinct null sensitive aggregators
+SELECT
+    first(DISTINCT a), last(DISTINCT a),
+    first(a), last(a),
+    first(DISTINCT b), last(DISTINCT b),
+    first(b), last(b)

Review comment:
       does it work if you specify order-by? first last are indeterministic so we should avoid relying on the order in any event




-- 
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.

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