AngersZhuuuu commented on a change in pull request #30869:
URL: https://github.com/apache/spark/pull/30869#discussion_r550438347



##########
File path: 
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
##########
@@ -2898,4 +2899,33 @@ class HiveDDLSuite
       }
     }
   }
+
+  test("SPARK-33865: Hive DDL with avro should check col name") {
+    withTable("tbl", "t1") {
+      withView("view1") {
+        spark.sql("CREATE TABLE tbl(id long)")
+        spark.sql("INSERT OVERWRITE TABLE tbl VALUES 4")
+        spark.sql("CREATE VIEW view1 AS SELECT id FROM tbl")
+
+
+        val e1 = intercept[SchemaParseException] {
+          spark.sql(s"CREATE TABLE t1 STORED AS AVRO " +

Review comment:
       
   > Can we also test CREATE TABL without AS SELECT?
   
   Without `as select`, col name is valid since we have check in parser level




----------------------------------------------------------------
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]

Reply via email to