Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19747#discussion_r153396436
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
---
@@ -117,6 +117,21 @@ class InMemoryCatalogedDDLSuite extends DDLSuite with
SharedSQLContext with Befo
}
}
+ test("SPARK-22431: table with nested type col with special char") {
+ withTable("t") {
+ spark.sql("CREATE TABLE t(q STRUCT<`$a`:INT, col2:STRING>, i1 INT)
USING PARQUET")
+ assert(spark.sql("SELECT * FROM t").count() == 0L)
+ }
+ }
+
+ test("SPARK-22431: view with nested type") {
+ withView("t", "v") {
+ spark.sql("CREATE VIEW t AS SELECT STRUCT('a' AS `$a`, 1 AS b) q")
+ checkAnswer(sql("SELECT * FROM t"), Row(Row("a", 1)) :: Nil)
+ spark.sql("CREATE VIEW v AS SELECT STRUCT('a' AS `a`, 1 AS b) q")
+ checkAnswer(sql("SELECT * FROM t"), Row(Row("a", 1)) :: Nil)
--- End diff --
The same issues in these two test cases
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]