GitHub user dongjoon-hyun opened a pull request:

    https://github.com/apache/spark/pull/14355

    [SPARK-16726][SQL] Improve error message for `Union` queries for 
incompatible types

    ## What changes were proposed in this pull request?
    
    Currently, `UNION` queries on incompatible types show misleading error 
messages, i.e., `unresolved operator Union`. We had better show a more correct 
message.
    
    **Before**
    ```
    scala> sql("select 1 union (select array(1))")
    org.apache.spark.sql.AnalysisException: unresolved operator 'Union;
    ```
    
    **After**
    ```
    scala> sql("select 1 union (select array(1))")
    org.apache.spark.sql.AnalysisException: Unions can only be performed on 
tables with the compatible column types, but one table has '[IntegerType]' and 
another table has '[ArrayType(IntegerType,false)]';
    ```
    
    ## How was this patch tested?
    
    Pass the Jenkins test with a new test case.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dongjoon-hyun/spark SPARK-16726

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/14355.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #14355
    
----
commit 98682a53b28a2848727599f1d06898cd70e8a19e
Author: Dongjoon Hyun <[email protected]>
Date:   2016-07-26T00:10:02Z

    [SPARK-16726][SQL] Improve error message for `Union` queries for 
incompatible types

----


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