Skip to content

Commit a58df40

Browse files
marmbruscloud-fan
authored andcommitted
add regression test for doubly nested data
1 parent 16bc4c6 commit a58df40

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ import org.apache.spark.sql.execution.{BroadcastHashJoin, ShuffledHashJoin}
2424
import org.apache.spark.sql.hive.test.TestHive
2525
import org.apache.spark.sql.hive.test.TestHive._
2626

27+
case class Nested1(f1: Nested2)
28+
case class Nested2(f2: Nested3)
29+
case class Nested3(f3: Int)
30+
2731
/**
2832
* A collection of hive query tests where we generate the answers ourselves instead of depending on
2933
* Hive to generate them (in contrast to HiveQuerySuite). Often this is because the query is
@@ -47,4 +51,11 @@ class SQLQuerySuite extends QueryTest {
4751
GROUP BY key, value
4852
ORDER BY value) a""").collect().toSeq)
4953
}
54+
55+
test("double nested data") {
56+
sparkContext.parallelize(Nested1(Nested2(Nested3(1))) :: Nil).registerTempTable("nested")
57+
checkAnswer(
58+
sql("SELECT f1.f2.f3 FROM nested"),
59+
1)
60+
}
5061
}

0 commit comments

Comments
 (0)