gengliangwang commented on a change in pull request #24806: 
[WIP][SPARK-27856][SQL] Only allow type upcasting when inserting table
URL: https://github.com/apache/spark/pull/24806#discussion_r292794102
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala
 ##########
 @@ -356,8 +358,28 @@ case class PreprocessTableInsertion(conf: SQLConf) 
extends Rule[LogicalPlan] {
           s"including ${staticPartCols.size} partition column(s) having 
constant value(s).")
     }
 
-    val newQuery = DDLPreprocessingUtils.castAndRenameQueryOutput(
-      insert.query, expectedColumns, conf)
+    val newQuery = if 
(conf.getConf(SQLConf.LEGACY_INSERT_TABLE_TYPE_COERCION)) {
+      DDLPreprocessingUtils.castAndRenameQueryOutput(insert.query, 
expectedColumns, conf)
+    } else {
+      val errors = new mutable.ArrayBuffer[String]()
 
 Review comment:
   We need to figure out if we can up-cast decimal to double/float. 
   If we can't, then maybe we can't continue this PR.
   I have created a new PR https://github.com/apache/spark/pull/24849

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


With regards,
Apache Git Services

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

Reply via email to