maropu commented on a change in pull request #26656: [SPARK-27986][SQL] Support ANSI SQL filter clause for aggregate expression URL: https://github.com/apache/spark/pull/26656#discussion_r351947184
########## File path: sql/core/src/test/resources/sql-tests/results/postgreSQL/aggregates_part3.sql.out ########## @@ -12,11 +12,41 @@ It is not allowed to use an aggregate function in the argument of another aggreg -- !query 1 +select min(unique1) filter (where unique1 > 100) from tenk1 +-- !query 1 schema +struct<min(unique1):int> +-- !query 1 output +101 + + +-- !query 2 +select sum(1/ten) filter (where ten > 0) from tenk1 +-- !query 2 schema +struct<sum((1 div ten)):bigint> +-- !query 2 output +1000 + + +-- !query 3 +select ten, sum(distinct four) filter (where four > 10) from onek a +group by ten +having exists (select 1 from onek b where sum(distinct a.four) = b.four) +-- !query 3 schema +struct<ten:int,sum(DISTINCT four):bigint> +-- !query 3 output +0 2 +2 2 +4 2 +6 2 +8 2 + Review comment: This result is different form one in PgSQL: https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/expected/aggregates.out#L1543-L1552 ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
