lidinghao commented on a change in pull request #25390: [SPARK-28662] [SQL] 
Create Hive Partitioned Table  DDL should fail  when partition column type 
missed
URL: https://github.com/apache/spark/pull/25390#discussion_r314028074
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
 ##########
 @@ -985,7 +985,15 @@ class SparkSqlAstBuilder(conf: SQLConf) extends 
AstBuilder(conf) {
         } else {
           CreateTable(tableDescWithPartitionColNames, mode, Some(q))
         }
-      case None => CreateTable(tableDesc, mode, None)
+      case None =>
+        // When creating partitioned table, we must specify data type for the 
partition columns.
+        if (Option(ctx.partitionColumnNames).isDefined) {
+          val errorMessage = "Create Partitioned Table must specify data type 
for " +
 
 Review comment:
   Done, already improved the error message in the latest commit 

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to