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

    https://github.com/apache/spark/pull/17236#discussion_r105351724
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
 ---
    @@ -319,7 +322,7 @@ trait CheckAnalysis extends PredicateHelper {
                   // Check if the data types match.
                   dataTypes(child).zip(ref).zipWithIndex.foreach { case ((dt1, 
dt2), ci) =>
                     // SPARK-18058: we shall not care about the nullability of 
columns
    -                if (TypeCoercion.findWiderTypeForTwo(dt1.asNullable, 
dt2.asNullable).isEmpty) {
    +                if (!dt1.sameType(dt2)) {
    --- End diff --
    
    We shouldn't change this. This makes sure we generate the correct error 
message for union. The problem is that an earlier pair of columns might not be 
the same but castable, while a later pair column is not the same and we can't 
cast them; the error should show the latter pair of columns and not the first 
one (which happens if we revert this).


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