GitHub user HyukjinKwon opened a pull request:

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

    [MINOR][SQL] Remove not affected settings for writing in CSV.

    ## What changes were proposed in this pull request?
    
    This PR removes not affected settings for writing CSV files.
    
    - `setComment()` : It seems Univocity parser supports to write comments but 
only by both 
[commentRow()](https://github.com/uniVocity/univocity-parsers/blob/93d1fb6437bdeb1531f27156e18e8d8ca7af572f/src/main/java/com/univocity/parsers/common/AbstractWriter.java#L751-L753)
 and 
[commentRowToString()](https://github.com/uniVocity/univocity-parsers/blob/93d1fb6437bdeb1531f27156e18e8d8ca7af572f/src/main/java/com/univocity/parsers/common/AbstractWriter.java#L1392-L1394).
 Both methods are not used in Spark.
    
    - `setLineSeparator()` : It seems this setting is only enabled when writing 
multiple lines and comments. However, CSV datasource does not write comments 
and write line by line by Hadoop's `LineRecordWriter`. Spark only uses this 
library with `\n` line separator with `LineRecordWriter`. Also, the end of each 
CSV line produced by Univocity is trimmed. (See 
[CSVParser.scala#L89](https://github.com/apache/spark/blob/73b56a3c6c5c590219b42884c8bbe88b0a236987/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVParser.scala#L89))
    ## How was this patch tested?
    
    Unittests in `CSVSuite` and `./build/sbt scalastyle`
    
    


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

    $ git pull https://github.com/HyukjinKwon/spark minor-remove-unused

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

    https://github.com/apache/spark/pull/12818.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 #12818
    
----
commit 9b570db3e777e728ea5215cf4affef6dfe1464e5
Author: hyukjinkwon <[email protected]>
Date:   2016-05-01T05:28:16Z

    Remove setting options not affected for writing in CSV.

----


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