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

    https://github.com/apache/spark/pull/19635#discussion_r148951520
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
 ---
    @@ -451,7 +451,10 @@ object TypeCoercion {
             }
     
           case i @ In(a, b) if b.exists(_.dataType != a.dataType) =>
    -        findWiderCommonType(i.children.map(_.dataType)) match {
    +        findWiderCommonType(b.map(_.dataType)).flatMap { listDataType =>
    +          findCommonTypeForBinaryComparison(listDataType, a.dataType)
    +            .orElse(findWiderTypeForTwo(listDataType, a.dataType))
    --- End diff --
    
    before this PR, we were calling always `findWiderCommonType` and this was 
applied to all the elements of the list and the value. Here, I am calling 
`findWiderTypeForTwo` if  `findCommonTypeForBinaryComparison` fails to have the 
same previous behavior in those cases.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to