You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2016/06/29 04:48:16 UTC

[GitHub] spark pull request #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option ba...

GitHub user gatorsmile opened a pull request:

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

    [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option back to Load API in DataFrameReader

    #### What changes were proposed in this pull request?
    When users only specify one and only one path, we use `options` to record the path value in `DataFrameReader`. For example, users can see the `path` option after the following API call,
    ```SQL
    spark.read.parquet("/test")
    ```
    
    In Python API, we have the same issue. Thanks for identifying this issue, @zsxwing ! Below is an example:
    ```Python
    spark.read.format('json').load('python/test_support/sql/people.json')
    ```
    #### How was this patch tested?
    Existing test cases cover the changes by this PR

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

    $ git pull https://github.com/gatorsmile/spark optionPaths

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

    https://github.com/apache/spark/pull/13965.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 #13965
    
----
commit 9cfd67350670ef668781cf498597612713cba628
Author: gatorsmile <ga...@gmail.com>
Date:   2016-06-29T04:38:57Z

    fix

----


---
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 issue #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option back to L...

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

    https://github.com/apache/spark/pull/13965
  
    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 issue #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option back to L...

Posted by zsxwing <gi...@git.apache.org>.
Github user zsxwing commented on the issue:

    https://github.com/apache/spark/pull/13965
  
    LGTM. Merging to master and 2.0. 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 issue #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option back to L...

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

    https://github.com/apache/spark/pull/13965
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61477/
    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 #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option ba...

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

    https://github.com/apache/spark/pull/13965#discussion_r68990242
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala ---
    @@ -244,7 +244,7 @@ class DataFrameReader private[sql](sparkSession: SparkSession) extends Logging {
        */
       def json(path: String): DataFrame = {
         // This method ensures that calls that explicit need single argument works, see SPARK-16009
    -    json(Seq(path): _*)
    +    option("path", path).json(Seq.empty: _*)
    --- End diff --
    
    nvm. I found the issue. Json, parquet and the other file formats will not affect the data source API developers. : ) Let me revert the changes.


---
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 issue #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option back to L...

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

    https://github.com/apache/spark/pull/13965
  
    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 issue #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option back to L...

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

    https://github.com/apache/spark/pull/13965
  
    **[Test build #61477 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61477/consoleFull)** for PR 13965 at commit [`f5100d6`](https://github.com/apache/spark/commit/f5100d646ffdf38464719344f47a94a285491c7a).
     * 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 issue #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option back to L...

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

    https://github.com/apache/spark/pull/13965
  
    **[Test build #61477 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61477/consoleFull)** for PR 13965 at commit [`f5100d6`](https://github.com/apache/spark/commit/f5100d646ffdf38464719344f47a94a285491c7a).


---
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 #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option ba...

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

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


---
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 issue #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option back to L...

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

    https://github.com/apache/spark/pull/13965
  
    **[Test build #61447 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61447/consoleFull)** for PR 13965 at commit [`9cfd673`](https://github.com/apache/spark/commit/9cfd67350670ef668781cf498597612713cba628).


---
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 #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option ba...

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

    https://github.com/apache/spark/pull/13965#discussion_r68989739
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala ---
    @@ -244,7 +244,7 @@ class DataFrameReader private[sql](sparkSession: SparkSession) extends Logging {
        */
       def json(path: String): DataFrame = {
         // This method ensures that calls that explicit need single argument works, see SPARK-16009
    -    json(Seq(path): _*)
    +    option("path", path).json(Seq.empty: _*)
    --- End diff --
    
    @zsxwing I see your point. The issue is from the others who build the data sources using the data source APIs. See the discussion in https://github.com/apache/spark/pull/13727#discussion_r68624316


---
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 issue #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option back to L...

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

    https://github.com/apache/spark/pull/13965
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/61447/
    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 issue #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option back to L...

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

    https://github.com/apache/spark/pull/13965
  
    **[Test build #61447 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/61447/consoleFull)** for PR 13965 at commit [`9cfd673`](https://github.com/apache/spark/commit/9cfd67350670ef668781cf498597612713cba628).
     * 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 #13965: [SPARK-16236] [SQL] [FOLLOWUP] Add Path Option ba...

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

    https://github.com/apache/spark/pull/13965#discussion_r68984206
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala ---
    @@ -244,7 +244,7 @@ class DataFrameReader private[sql](sparkSession: SparkSession) extends Logging {
        */
       def json(path: String): DataFrame = {
         // This method ensures that calls that explicit need single argument works, see SPARK-16009
    -    json(Seq(path): _*)
    +    option("path", path).json(Seq.empty: _*)
    --- End diff --
    
    @gatorsmile setting `path` or `paths` are both fine for json, parquet, and other file formats. See https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSource.scala#L312
    
    You don't need to change this file.


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