Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19124#discussion_r137146817
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
 ---
    @@ -130,10 +130,12 @@ case class DataSourceAnalysis(conf: SQLConf) extends 
Rule[LogicalPlan] with Cast
     
       override def apply(plan: LogicalPlan): LogicalPlan = plan transform {
         case CreateTable(tableDesc, mode, None) if 
DDLUtils.isDatasourceTable(tableDesc) =>
    +      DDLUtils.checkFieldNames(tableDesc)
           CreateDataSourceTableCommand(tableDesc, ignoreIfExists = mode == 
SaveMode.Ignore)
     
         case CreateTable(tableDesc, mode, Some(query))
             if query.resolved && DDLUtils.isDatasourceTable(tableDesc) =>
    +      DDLUtils.checkFieldNames(tableDesc.copy(schema = query.schema))
           CreateDataSourceTableAsSelectCommand(tableDesc, mode, query)
     
         case InsertIntoTable(l @ LogicalRelation(_: InsertableRelation, _, _, 
_),
    --- End diff --
    
    Sorry, but I'm not sure when `INSERT INTO TABLE` has this kind of issue.
    In case of `INSERT INTO`, the table already exists.


---

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

Reply via email to