You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by anabranch <gi...@git.apache.org> on 2016/05/11 01:48:53 UTC

[GitHub] spark pull request: fix SPARK-15264, add test cases

GitHub user anabranch opened a pull request:

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

    fix SPARK-15264, add test cases

    

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

    $ git pull https://github.com/anabranch/spark master

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

    https://github.com/apache/spark/pull/13041.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 #13041
    
----
commit 17b3c580518663577b015d30d6700e32e3aa2052
Author: Bill Chambers <bi...@databricks.com>
Date:   2016-05-11T01:44:28Z

    fix SPARK-15264, add test cases

----


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218348780
  
    **[Test build #58315 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58315/consoleFull)** for PR 13041 at commit [`85d0843`](https://github.com/apache/spark/commit/85d08434b620241d698edeaa6557e8a715816185).


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218341906
  
    **[Test build #58308 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58308/consoleFull)** for PR 13041 at commit [`17b3c58`](https://github.com/apache/spark/commit/17b3c580518663577b015d30d6700e32e3aa2052).


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218633927
  
    I am not a committer and I might not have the right to say this but  in my point of view, this change should not be included in Spark 2.0 but 2.1. I think this change will affect the consistency of behaviour of field names having empty strings across SparkSQL and I think it is not clarified yet.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218357314
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58315/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13041#discussion_r62793802
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/DefaultSource.scala ---
    @@ -61,7 +61,9 @@ class DefaultSource extends FileFormat with DataSourceRegister {
         val firstRow = new LineCsvReader(csvOptions).parseLine(firstLine)
     
         val header = if (csvOptions.headerFlag) {
    -      firstRow
    +      firstRow.zipWithIndex.map { case (value, index) =>
    +        if (value == "" || value == null) s"C$index" else value
    --- End diff --
    
    I mean if the header is a empty string then, I think the field name should be a empty string since apparently it works with fields named empty strings. I tested this by manually giving a schema. If the header is used for schema, then I think the names should be as they are. We don't really change field names specified in ORC, Parquet or JSON.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218630250
  
    This patch itself LGTM. I'm going to merge it into master 2.0. @HyukjinKwon let's move our discussion about `nullValue` and `emptyValue` defaults to #12904.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218580402
  
    The only changes I would suggest here are:
    (1) Change the condition to `value == null || value.isEmpty || value == csvOptions.nullValue`
    (2) Renaming `C0` to `_c0`
    Otherwise this patch LGTM.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218351065
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58308/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13041#discussion_r62936110
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/DefaultSource.scala ---
    @@ -61,9 +61,11 @@ class DefaultSource extends FileFormat with DataSourceRegister {
         val firstRow = new LineCsvReader(csvOptions).parseLine(firstLine)
     
         val header = if (csvOptions.headerFlag) {
    -      firstRow
    +      firstRow.zipWithIndex.map { case (value, index) =>
    +        if (value == null || value.isEmpty || value == csvOptions.nullValue) s"_c$index" else value
    +      }
         } else {
    -      firstRow.zipWithIndex.map { case (value, index) => s"C$index" }
    +      firstRow.zipWithIndex.map { case (value, index) => s"_c$index" }
    --- End diff --
    
    Why this should be `_c`?


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218357216
  
    **[Test build #58315 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58315/consoleFull)** for PR 13041 at commit [`85d0843`](https://github.com/apache/spark/commit/85d08434b620241d698edeaa6557e8a715816185).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218579388
  
    @HyukjinKwon I think we should rename both null and empty strings. In both cases there's no way to query the column. Also I looked at the other two patches and although they're related they really don't block this patch. This patch only touches the header. I think it's OK to merge this one independent of the other two.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13041#discussion_r62936873
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/DefaultSource.scala ---
    @@ -61,9 +61,11 @@ class DefaultSource extends FileFormat with DataSourceRegister {
         val firstRow = new LineCsvReader(csvOptions).parseLine(firstLine)
     
         val header = if (csvOptions.headerFlag) {
    -      firstRow
    +      firstRow.zipWithIndex.map { case (value, index) =>
    +        if (value == null || value.isEmpty || value == csvOptions.nullValue) s"_c$index" else value
    +      }
         } else {
    -      firstRow.zipWithIndex.map { case (value, index) => s"C$index" }
    +      firstRow.zipWithIndex.map { case (value, index) => s"_c$index" }
    --- End diff --
    
    to be consistent with what Spark does with unnamed columns. See my comment above.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218363294
  
    @anabranch First of all, I think currently (at least for me) it is really confusing to deal with `null`, `""` and empty string in CSV. I am trying to make this clear here and there (eg.https://github.com/apache/spark/pull/12921). So, I hope we can hold off this at least that PR is merged.
    
    Secondly, JSON data source would not support empty strings as fields. I think we should clarify what we want for empty strings. For example, JSON data sources simply ignores when it meets empty strings as far as I know but CSV data sources currently throws NPE. Also, I think we need to decide if we are going to support fields named empty strings or not for data sources.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218630690
  
    @andrewor14 Then, do you mind if this should be supported for JSON data source as well?


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218623339
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218350952
  
    **[Test build #58308 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58308/consoleFull)** for PR 13041 at commit [`17b3c58`](https://github.com/apache/spark/commit/17b3c580518663577b015d30d6700e32e3aa2052).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218602275
  
    Merged build finished. Test FAILed.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218602160
  
    @andrewor14 they are related because the first row is already parsed by Univocity parser in which `nullValue` is set, [here](https://github.com/apache/spark/blob/ac12b35d31ef1d1663511bf6ae826a9cc0278f20/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/CSVParser.scala#L48). Both PRs are handling `nullValue` to treat `""` and empty string and it seems currently `nullValue` with Univocity parser is working differently with what Spark expected in CSV datasource library. This is what I meant confusing.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218349299
  
    Related with https://github.com/apache/spark/pull/12904 and https://github.com/apache/spark/pull/12921.
    
    @andrewor14 Do you mind if I review this?


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218644105
  
    @marmbrus I am sorry that I said that without knowing the background enough. I wanted to say that might break the consistency of dealing with fields in Spark SQL but it seems merged quickly. I remember I was told Spark 2.0 release is very close and I intended to say this might be quickly consistent if it is problematic.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218583977
  
    **[Test build #58399 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58399/consoleFull)** for PR 13041 at commit [`d665bea`](https://github.com/apache/spark/commit/d665bea023b5f4aa9bfe2b2ccbc46586e07bc396).


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218602278
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58399/
    Test FAILed.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218345563
  
    (I think it would be nicer if the PR description is fill up.)


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218602134
  
    **[Test build #58399 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58399/consoleFull)** for PR 13041 at commit [`d665bea`](https://github.com/apache/spark/commit/d665bea023b5f4aa9bfe2b2ccbc46586e07bc396).
     * This patch **fails PySpark unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218351064
  
    Merged build finished. Test PASSed.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by marmbrus <gi...@git.apache.org>.
Github user marmbrus commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218642602
  
    @HyukjinKwon Spark 2.0 has not been released yet and thus CSV has never been in a released version of Spark.  Why would you want to break compatibility in Spark 2.0 and 2.1 instead of just getting it right from the beginning in 2.0.  I think these are exactly the kind of API audits we should be doing before the release.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218606098
  
    **[Test build #58415 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58415/consoleFull)** for PR 13041 at commit [`d983718`](https://github.com/apache/spark/commit/d98371859d78706cb9673f253b4dccbffb9fc385).


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by anabranch <gi...@git.apache.org>.
Github user anabranch commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218341617
  
    cc: @andrewor14 


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218622985
  
    **[Test build #58415 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58415/consoleFull)** for PR 13041 at commit [`d983718`](https://github.com/apache/spark/commit/d98371859d78706cb9673f253b4dccbffb9fc385).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13041#discussion_r62939104
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/DefaultSource.scala ---
    @@ -61,9 +61,11 @@ class DefaultSource extends FileFormat with DataSourceRegister {
         val firstRow = new LineCsvReader(csvOptions).parseLine(firstLine)
     
         val header = if (csvOptions.headerFlag) {
    -      firstRow
    +      firstRow.zipWithIndex.map { case (value, index) =>
    +        if (value == null || value.isEmpty || value == csvOptions.nullValue) s"_c$index" else value
    +      }
         } else {
    -      firstRow.zipWithIndex.map { case (value, index) => s"C$index" }
    +      firstRow.zipWithIndex.map { case (value, index) => s"_c$index" }
    --- End diff --
    
    I see. Thanks.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by anabranch <gi...@git.apache.org>.
Github user anabranch commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13041#discussion_r62793571
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/DefaultSource.scala ---
    @@ -61,7 +61,9 @@ class DefaultSource extends FileFormat with DataSourceRegister {
         val firstRow = new LineCsvReader(csvOptions).parseLine(firstLine)
     
         val header = if (csvOptions.headerFlag) {
    -      firstRow
    +      firstRow.zipWithIndex.map { case (value, index) =>
    +        if (value == "" || value == null) s"C$index" else value
    --- End diff --
    
    This code does rename it with the index and prefix, `C`.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218623499
  
    Could I maybe ask your thoughts on the comment above https://github.com/apache/spark/pull/13041#issuecomment-218604088? 


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13041#discussion_r62792044
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/DefaultSource.scala ---
    @@ -61,7 +61,9 @@ class DefaultSource extends FileFormat with DataSourceRegister {
         val firstRow = new LineCsvReader(csvOptions).parseLine(firstLine)
     
         val header = if (csvOptions.headerFlag) {
    -      firstRow
    +      firstRow.zipWithIndex.map { case (value, index) =>
    +        if (value == "" || value == null) s"C$index" else value
    --- End diff --
    
    I see Spark allows a empty string as a field. So, I wonder if we should rename this with the index and prefix, `C`. Also, I think `""` will throw an NPE whereas empty string without quotes will produce a correct field because the default of `nullValue` is `""`.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218630138
  
    I talked with @marmbrus and @yhuai offline about the semantics of blank and empty strings in the header row. For the latter, I can't imagine a user actually intending to name the column empty string because you can't actually query the column that way, so we should just rename that.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by marmbrus <gi...@git.apache.org>.
Github user marmbrus commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218651518
  
    That's okay, is good to be cautious around release time. I just wanted to
    be clear why I thought merging in this case was justified :)



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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13041#discussion_r62920728
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/DefaultSource.scala ---
    @@ -61,7 +61,9 @@ class DefaultSource extends FileFormat with DataSourceRegister {
         val firstRow = new LineCsvReader(csvOptions).parseLine(firstLine)
     
         val header = if (csvOptions.headerFlag) {
    -      firstRow
    +      firstRow.zipWithIndex.map { case (value, index) =>
    +        if (value == "" || value == null) s"C$index" else value
    +      }
         } else {
           firstRow.zipWithIndex.map { case (value, index) => s"C$index" }
    --- End diff --
    
    I talked to @marmbrus offline. [Elsewhere](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/catalyst/SQLBuilder.scala#L523) we use `_c0` instead of `C0`, so we should make that consistent. You're gonna have to change the name both here and in L65.


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218606877
  
    @HyukjinKwon I'm not saying they're not related. I'm just saying it's not necessary to block progress on this patch because of the other ones. I agree that we should decide what the proper defaults for `nullValue` and `emptyValue` are, but that's a separate issue.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218354784
  
    sure, you don't have to ask for permission to review a patch


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218604088
  
    @andrewor14 Also, I am careful of this because the header might be intendedly a empty string, meaning the field name is literally a empty string. For example, for me the header below
    
    ```
    ,,1,2,3
    ```
    
    might mean
    
    ```
    ["","","1","2","3"]
    ```
    
    just like
    ```
    a,a,1,2,3
    ```
    
    will be
    
    ```
    ["a","a","1","2,"3,"]
    ```
    
    Shouldn't this be supported with a separate option if this should be supported? (I am a bit less sure why duplicated field names (empty string) should be allowed, though.)


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218623342
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58415/
    Test PASSed.


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218581276
  
    Also, once you fix those can you add [SPARK-15274] to the title?


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


[GitHub] spark pull request: [SPARK-15264][SPARK-15274][SQL] CSV Reader Err...

Posted by HyukjinKwon <gi...@git.apache.org>.
Github user HyukjinKwon commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218610605
  
    (I remember , for example, setting `nullValue` for `"abc"` will affect the values what Univocity thinks are `null` ending up with duplicated field names `"abc"`. I think we might havw to remove this for Univocity and treat all `null` in Spark
     I will test and tell you what I think when I get to my computer.)


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


[GitHub] spark pull request: [SPARK-15264][SQL] CSV Reader Error on Blank C...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/13041#issuecomment-218357313
  
    Merged build finished. Test PASSed.


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