You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by antoniobarbuzzi <gi...@git.apache.org> on 2016/11/03 13:59:44 UTC

[GitHub] spark issue #12904: [SPARK-15125][SQL] Changing CSV data source mapping of e...

Github user antoniobarbuzzi commented on the issue:

    https://github.com/apache/spark/pull/12904
  
    I agree with @HyukjinKwon and comment https://github.com/apache/spark/pull/12904#issuecomment-217605160, except for third use case, i.e. I'd rather do this:
    
    With the option, nullValue set to `""`
    `"","a",` should be converted to `Row("", "a", null)`
    
    In fact, just like the univocity parser does [here](https://github.com/uniVocity/univocity-parsers/blob/master/src/main/java/com/univocity/parsers/csv/CsvParserSettings.java#L63-L72):
    > if the parser does not read any character from the input, and the input is within quotes , the empty is used instead of an empty string
    
    
    Regarding the PR, I'd deletegate the handling of this to the univocity parser, setting the `settings.setEmptyValue(params.emptyValue)` in the univocity's CSVSettings [here](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVParser.scala#L34) and [here](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVParser.scala#L77) too.


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

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