GitHub user 10110346 opened a pull request:

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

    [SPARK-25574][SQL]Add an option `keepQuotes` for parsing csv file

    ## What changes were proposed in this pull request?
    
    In the PR, I added new option for csv file - `keepQuotes`.
    In our project, when we read the CSV file, we hope to keep quotes.
    
    For example:
    We have such a record in the CSV file.:
    `ab,cc,,"c,ddd"`
    
    We hope it displays like this:
    +----+---+----+---+
    | _c0 | _c1 | _c2  |   _c3 |
    +---+---+----+----+
    |  ab  |  cc   |  null     | `"c,ddd"` |
    
    Not like this:
    +----+---+----+----+
    | _c0 |  _c1  | _c2 |   _c3  |
    +---+----+----+----+
    |  ab   |  cc   |  null   | c,ddd |
    +----+---+----+---+
    
    
    
    ## How was this patch tested?
    Added a unit test.


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

    $ git pull https://github.com/10110346/spark keepquotes

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

    https://github.com/apache/spark/pull/22590.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 #22590
    
----
commit 9c46a72517e5235e10ba0325b63817eefe5d71dd
Author: liuxian <liu.xian3@...>
Date:   2018-09-29T07:15:47Z

    fix

----


---

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

Reply via email to