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

    https://github.com/apache/spark/pull/16057#discussion_r90157966
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
 ---
    @@ -714,6 +714,17 @@ object TypeCoercion {
             // try to find the first one we can implicitly cast.
             case (_, TypeCollection(types)) => types.flatMap(implicitCast(e, 
_)).headOption.orNull
     
    +        case (ArrayType(_, nullable), ArrayType(internalType: DataType, 
expectedNullable))
    +          if (expectedNullable || nullable == expectedNullable) =>
    --- End diff --
    
    We should also consider the case forcing the casting result is null. Please 
see 
https://github.com/apache/spark/blob/7eb2ca8e338e04034a662920261e028f56b07395/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala#L94



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to