Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21100#discussion_r184027821
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
 ---
    @@ -112,6 +112,14 @@ object TypeCoercion {
             StructField(f1.name, dataType, nullable = f1.nullable || 
f2.nullable)
           }))
     
    +    case (a1 @ ArrayType(et1, hasNull1), a2 @ ArrayType(et2, hasNull2)) if 
a1.sameType(a2) =>
    +      findTightestCommonType(et1, et2).map(ArrayType(_, hasNull1 || 
hasNull2))
    +
    +    case (m1 @ MapType(kt1, vt1, hasNull1), m2 @ MapType(kt2, vt2, 
hasNull2)) if m1.sameType(m2) =>
    +      val keyType = findTightestCommonType(kt1, kt2)
    +      val valueType = findTightestCommonType(vt1, vt2)
    --- End diff --
    
    BTW, I think we should do the same thing in `findWiderTypeForTwo` to cover 
some corner cases such as decimal or string promotion within keys and values .. 
? and seems https://github.com/apache/spark/pull/21100#discussion_r183032551 
suggested the same thing ..?


---

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

Reply via email to