You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/08/07 14:37:03 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #25198: [SPARK-28443][SQL] Spark sql add exception when create field type NullType

cloud-fan commented on a change in pull request #25198: [SPARK-28443][SQL] Spark sql add exception when create field type NullType
URL: https://github.com/apache/spark/pull/25198#discussion_r311589702
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala
 ##########
 @@ -393,6 +393,43 @@ case class PreprocessTableInsertion(conf: SQLConf) extends Rule[LogicalPlan] {
   }
 }
 
+/**
+ * SPARK-28443: Spark sql add exception when create field type NullType
+ */
+object DDLCheck extends (LogicalPlan => Unit) {
+
+  def failAnalysis(msg: String): Unit = { throw new AnalysisException(msg) }
+
+  def throwWhenExistsNullType(schema: StructType): Unit = {
+    if (schema.exists(f => DataTypes.NullType.sameType(f.dataType))) {
 
 Review comment:
   what about nested filed? Do other databases forbid it as well?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org