Skip to content

Commit 29e6485

Browse files
committed
Fix
1 parent 00f6ad9 commit 29e6485

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

sql/core/src/test/resources/sql-tests/inputs/group-by.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,8 @@ SELECT 1 from (
6868
FROM (select 1 as x) a
6969
WHERE false
7070
) b
71-
where b.z != b.z
71+
where b.z != b.z;
72+
73+
-- SPARK-24369 multiple distinct aggregations having the same argument set
74+
SELECT corr(DISTINCT x, y), corr(DISTINCT y, x), count(*)
75+
FROM (VALUES (1, 1), (2, 2), (2, 2)) t(x, y);

sql/core/src/test/resources/sql-tests/results/group-by.sql.out

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Automatically generated by SQLQueryTestSuite
2-
-- Number of queries: 26
2+
-- Number of queries: 27
33

44

55
-- !query 0
@@ -241,3 +241,12 @@ where b.z != b.z
241241
struct<1:int>
242242
-- !query 25 output
243243

244+
245+
246+
-- !query 26
247+
SELECT corr(DISTINCT x, y), corr(DISTINCT y, x), count(*)
248+
FROM (VALUES (1, 1), (2, 2), (2, 2)) t(x, y)
249+
-- !query 26 schema
250+
struct<corr(DISTINCT CAST(x AS DOUBLE), CAST(y AS DOUBLE)):double,corr(DISTINCT CAST(y AS DOUBLE), CAST(x AS DOUBLE)):double,count(1):bigint>
251+
-- !query 26 output
252+
1.0 1.0 3

sql/core/src/test/scala/org/apache/spark/sql/DataFrameAggregateSuite.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -687,12 +687,4 @@ class DataFrameAggregateSuite extends QueryTest with SharedSQLContext {
687687
}
688688
}
689689
}
690-
691-
test("SPARK-24369 multiple distinct aggregations having the same argument set") {
692-
val df = sql(
693-
s"""SELECT corr(DISTINCT x, y), corr(DISTINCT y, x), count(*)
694-
| FROM (VALUES (1, 1), (2, 2), (2, 2)) t(x, y)
695-
""".stripMargin)
696-
checkAnswer(df, Row(1.0, 1.0, 3))
697-
}
698690
}

0 commit comments

Comments
 (0)