GitHub user umesh9794 opened a pull request:

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

    [SPARK-20319][SQL] Already quoted identifiers are getting wrapped with 
additional quotes

    ## What changes were proposed in this pull request?
    
    Currently JDBC Writer uses dialects to quote the field names but when the 
quotes are explicitly wrapped with the column names, JDBC driver fails to parse 
columns with two double quotes e.g. ""columnName"". 
    
    **Below code describes the error scenario:**
    
    `CAS_AP = sqlContext.sql("select CAS_c1 as c1, CAS_c2 as c2 from CAS_TMP")`
    `CAS_AP = CAS_AP.toDF('"c1"', '"c2"')`
    `print("========= %s   : CAS_AP =========" % type(CAS_AP).__name__)`
    `CAS_AP.show()`
    `CAS_AP.printSchema()`
    `props =  getSqlJDBCProps(sc)`
    `url = "jdbc:oracle:thin:@//host:1521/flex"`
    `driver = "oracle.jdbc.OracleDriver"`
    `target_table = 'sampleTable'`
    `CAS_AP.write.jdbc(url, target_table, 'append', props) `
    
    
    ## How was this patch tested?
    
    Jenkins tests and manually created the above unit test case.

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

    $ git pull https://github.com/umesh9794/spark local

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

    https://github.com/apache/spark/pull/17631.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 #17631
    
----
commit 48b4527b9543480c571443a4f4e0e63d067e5c0a
Author: umesh9794 <[email protected]>
Date:   2017-04-13T08:24:10Z

    SPARK-20319: Already quoted identifiers are getting wrapped with additional 
quotes

commit d3d0e8cb1ac2d568fb617aa04f778e494a04f072
Author: umesh9794 <[email protected]>
Date:   2017-04-13T08:48:45Z

    SPARK-20319: Already quoted identifiers are getting wrapped with additional 
quotes

----


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