You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by hvanhovell <gi...@git.apache.org> on 2017/03/10 08:39:29 UTC

[GitHub] spark pull request #17236: [SPARK-19893][SQL] Cannot run intersect/except wi...

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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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