ulysses-you commented on a change in pull request #29152:
URL: https://github.com/apache/spark/pull/29152#discussion_r457225005
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/PlanResolutionSuite.scala
##########
@@ -1557,6 +1557,17 @@ class PlanResolutionSuite extends AnalysisTest {
checkFailure("testcat.tab", "foo")
}
+ test("SPARK-32356: forbid null type in create view") {
+ val sql1 = "create view v as select null as c"
+ val sql2 = "alter view v as select null as c"
Review comment:
added.
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/PlanResolutionSuite.scala
##########
@@ -1557,6 +1557,17 @@ class PlanResolutionSuite extends AnalysisTest {
checkFailure("testcat.tab", "foo")
}
+ test("SPARK-32356: forbid null type in create view") {
+ val sql1 = "create view v as select null as c"
+ val sql2 = "alter view v as select null as c"
+ Seq(sql1, sql2).foreach { sql =>
+ val msg = intercept[AnalysisException] {
+ parseAndResolve(sql)
+ }.getMessage
+ assert(msg.contains(s"Cannot create tables with ${NullType.simpleString}
type."))
Review comment:
updated
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]