GitHub user gatorsmile opened a pull request:

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

    [SPARK-17693] [SQL] Fixed Insert Failure To Data Source Tables when the 
Schema has the Comment Field

    ### What changes were proposed in this pull request?
    ```SQL
    CREATE TABLE tab1(col1 int COMMENT 'a', col2 int) USING parquet
    INSERT INTO TABLE tab1 SELECT 1, 2
    ```
    The insert attempt will fail if the target table has a column with 
comments. The error is strange to the external users:
    ```
    assertion failed: No plan for InsertIntoTable Relation[col1#15,col2#16] 
parquet, false, false
    +- Project [1 AS col1#19, 2 AS col2#20]
       +- OneRowRelation$
    ```
    
    This PR is to fix the above bug by ignoring the metadata when comparing the 
schema between the table and the query.
    
    ### How was this patch tested?
    Added a test case

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

    $ git pull https://github.com/gatorsmile/spark 
insertDataSourceTableWithComment

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

    https://github.com/apache/spark/pull/15266.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 #15266
    
----
commit ff0e7c7c84c12e2cd5277440538f453f019a6f8e
Author: gatorsmile <[email protected]>
Date:   2016-09-27T18:25:37Z

    fix.

----


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