GitHub user HyukjinKwon opened a pull request:

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

    [SPARK-19544][SQL] Improve error message when some column types are 
compatible and others are not in set/union operations

    ## What changes were proposed in this pull request?
    
    This PR proposes to fix the error message when some data types are 
compatible and others are not in set/union operation.
    
    ```scala
    Seq((1,("a", 1))).toDF.union(Seq((1L,("a", "b"))).toDF)
    ```
    
    **Before**
    
    ```
    Union can only be performed on tables with the compatible column types.
    LongType <> IntegerType at the first column of the second table;;
    ```
    
    **After**
    
    ```
    Union can only be performed on tables with the compatible column types. 
    StructType(StructField(_1,StringType,true), 
StructField(_2,StringType,true)) <> StructType(StructField(_1,StringType,true), 
StructField(_2,IntegerType,false)) at the second column of the second table;;
    ```
    
    ## How was this patch tested?
    
    Unit tests in `AnalysisErrorSuite` and manual tests.


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

    $ git pull https://github.com/HyukjinKwon/spark SPARK-19544

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

    https://github.com/apache/spark/pull/16882.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 #16882
    
----
commit 07e698415bb6a48e60cd2359cd9d412c2f61e48b
Author: hyukjinkwon <gurwls...@gmail.com>
Date:   2017-02-10T05:01:16Z

    Improve error message when some column types are compatible and others are 
not in set/union operations

----


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

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

Reply via email to