Skip to content

Commit 7f2b6f0

Browse files
author
Eric Liang
committed
add regression test
1 parent 05bd1e4 commit 7f2b6f0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
package org.apache.spark.sql
1919

2020
import org.apache.spark.sql.catalyst.analysis._
21+
import org.apache.spark.sql.catalyst.expressions._
22+
import org.apache.spark.sql.catalyst.plans._
2123
import org.apache.spark.sql.test._
2224

2325
/* Implicits */
@@ -133,6 +135,18 @@ class DslQuerySuite extends QueryTest {
133135
mapData.take(1).toSeq)
134136
}
135137

138+
test("SPARK-3395 limit distinct") {
139+
val filtered = TestData.testData2
140+
.distinct()
141+
.orderBy(SortOrder('a, Ascending), SortOrder('b, Ascending))
142+
.limit(1)
143+
.registerTempTable("onerow")
144+
checkAnswer(
145+
sql("select * from onerow inner join testData2 on onerow.a = testData2.a"),
146+
(1, 1, 1, 1) ::
147+
(1, 1, 1, 2) :: Nil)
148+
}
149+
136150
test("average") {
137151
checkAnswer(
138152
testData2.groupBy()(avg('a)),

0 commit comments

Comments
 (0)