cloud-fan commented on a change in pull request #27657: [SPARK-30899]: 
CreateArray/CreateMap's data type should not depend on SQLConf.get
URL: https://github.com/apache/spark/pull/27657#discussion_r382422992
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
 ##########
 @@ -553,10 +553,14 @@ object TypeCoercion {
       // Skip nodes who's children have not been resolved yet.
       case e if !e.childrenResolved => e
 
-      case a @ CreateArray(children) if 
!haveSameType(children.map(_.dataType)) =>
+      case a @ CreateArray(children, useStringTypeWhenEmpty)
+        if !haveSameType(children.map(_.dataType)) =>
         val types = children.map(_.dataType)
         findWiderCommonType(types) match {
-          case Some(finalDataType) => 
CreateArray(children.map(castIfNotSameType(_, finalDataType)))
+          case Some(finalDataType) => CreateArray(
 
 Review comment:
   nit: `a.copy(children = ...)`, then we don't need the 
`useStringTypeWhenEmpty` parameter and can just write `case a @ 
CreateArray(children, _)`

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