You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by actuaryzhang <gi...@git.apache.org> on 2017/05/16 17:06:58 UTC

[GitHub] spark pull request #18003: [SparkR] Fix bad examples in DataFrame methods

GitHub user actuaryzhang opened a pull request:

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

    [SparkR] Fix bad examples in DataFrame methods

    ## What changes were proposed in this pull request?
    Some examples in the DataFrame methods are syntactically wrong, even though they are pseudo code. Fix these and some style issues.  
    


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

    $ git pull https://github.com/actuaryzhang/spark sparkRDoc3

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

    https://github.com/apache/spark/pull/18003.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 #18003
    
----
commit d2f4d29a4c5f074a62fa94891e427f9bf70202ed
Author: Wayne Zhang <ac...@uber.com>
Date:   2017-05-16T06:30:12Z

    correct bad examples

----


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods an...

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

    https://github.com/apache/spark/pull/18003#discussion_r116853922
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -54,7 +54,8 @@ setMethod("lit", signature("ANY"),
     #' @name abs
     #' @family normal_funcs
     #' @export
    -#' @examples \dontrun{abs(df$c)}
    +#' @examples
    +#' \dontrun{abs(df$c)}
    --- End diff --
    
    I'm actually not sure about this change - if the example is simple and is single line, I think they can go on the same line as `@example` tag.
    More importantly though, I don't think majority of SQL function examples like this is usable or useful actually, and would rather have multi-line "real" example



---
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 #18003: [SparkR] Fix bad examples in DataFrame methods

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

    https://github.com/apache/spark/pull/18003
  
    **[Test build #76976 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76976/testReport)** for PR 18003 at commit [`d2f4d29`](https://github.com/apache/spark/commit/d2f4d29a4c5f074a62fa94891e427f9bf70202ed).
     * 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 #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    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 #18003: [SparkR] Fix bad examples in DataFrame methods

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

    https://github.com/apache/spark/pull/18003
  
    **[Test build #76976 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76976/testReport)** for PR 18003 at commit [`d2f4d29`](https://github.com/apache/spark/commit/d2f4d29a4c5f074a62fa94891e427f9bf70202ed).


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods

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

    https://github.com/apache/spark/pull/18003
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76976/
    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 #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    **[Test build #76979 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76979/testReport)** for PR 18003 at commit [`a919d9f`](https://github.com/apache/spark/commit/a919d9fce82648b421647923b3e2d5106b67e0f5).
     * 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 #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    FYI. Can't merge in the moment - give me a day or 2.


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    **[Test build #76979 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76979/testReport)** for PR 18003 at commit [`a919d9f`](https://github.com/apache/spark/commit/a919d9fce82648b421647923b3e2d5106b67e0f5).


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods an...

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

    https://github.com/apache/spark/pull/18003#discussion_r116854470
  
    --- Diff: R/pkg/R/DataFrame.R ---
    @@ -2814,7 +2815,7 @@ setMethod("except",
     #' path <- "path/to/file.json"
     #' df <- read.json(path)
     #' write.df(df, "myfile", "parquet", "overwrite")
    -#' saveDF(df, parquetPath2, "parquet", mode = saveMode, mergeSchema = mergeSchema)
    +#' saveDF(df, parquetPath2, "parquet", mode = "overwrite")
    --- End diff --
    
    I'd prefer to keep the `mergeSchema` param 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 issue #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    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 #18003: [SparkR] Fix bad examples in DataFrame methods

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

    https://github.com/apache/spark/pull/18003
  
    @bdwyer2 Thanks for the suggestion. I ran a check on all the R scripts and fixed the style issues. 


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods an...

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

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


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods

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

    https://github.com/apache/spark/pull/18003#discussion_r116820964
  
    --- Diff: R/pkg/R/DataFrame.R ---
    @@ -3175,7 +3176,8 @@ setMethod("with",
     #' @aliases str,SparkDataFrame-method
     #' @family SparkDataFrame functions
     #' @param object a SparkDataFrame
    -#' @examples \dontrun{
    +#' @examples
    +#' \dontrun{
    --- End diff --
    
    There are a lot of these in `functions.R`. Maybe you could fix them too with this PR?


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    @felixcheung Thanks for your suggestion. I reverted back the change on single line example. 
    I agree that the examples in sql are not informative. I will put in better examples in another PR.


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods

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

    https://github.com/apache/spark/pull/18003
  
    @felixcheung 


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    **[Test build #76993 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76993/testReport)** for PR 18003 at commit [`1450dd1`](https://github.com/apache/spark/commit/1450dd1a2e43e81afd35ba7fefcfbe8834b5c198).


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76979/
    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 #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    merged to master


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76993/
    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 #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    Thanks for the update. I will work on better examples on these functions.


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods an...

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

    https://github.com/apache/spark/pull/18003#discussion_r116888993
  
    --- Diff: R/pkg/R/functions.R ---
    @@ -54,7 +54,8 @@ setMethod("lit", signature("ANY"),
     #' @name abs
     #' @family normal_funcs
     #' @export
    -#' @examples \dontrun{abs(df$c)}
    +#' @examples
    +#' \dontrun{abs(df$c)}
    --- End diff --
    
    Agree. Reverted the change.


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods an...

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

    https://github.com/apache/spark/pull/18003#discussion_r116886110
  
    --- Diff: R/pkg/R/DataFrame.R ---
    @@ -2814,7 +2815,7 @@ setMethod("except",
     #' path <- "path/to/file.json"
     #' df <- read.json(path)
     #' write.df(df, "myfile", "parquet", "overwrite")
    -#' saveDF(df, parquetPath2, "parquet", mode = saveMode, mergeSchema = mergeSchema)
    +#' saveDF(df, parquetPath2, "parquet", mode = "overwrite")
    --- End diff --
    
    added it back


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods an...

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

    https://github.com/apache/spark/pull/18003#discussion_r116853266
  
    --- Diff: R/pkg/R/DataFrame.R ---
    @@ -2814,7 +2815,7 @@ setMethod("except",
     #' path <- "path/to/file.json"
     #' df <- read.json(path)
     #' write.df(df, "myfile", "parquet", "overwrite")
    -#' saveDF(df, parquetPath2, "parquet", mode = saveMode, mergeSchema = mergeSchema)
    +#' saveDF(df, parquetPath2, "parquet", mode = "overwrite")
    --- End diff --
    
    the example with these parameter are actually intentional - it is to show what additional properties can be set.
    but I'd agree if they run as-is it would be preferred


---
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 #18003: [SparkR] Fix bad examples in DataFrame methods

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

    https://github.com/apache/spark/pull/18003
  
    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 #18003: [SparkR] Fix bad examples in DataFrame methods and style...

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

    https://github.com/apache/spark/pull/18003
  
    **[Test build #76993 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76993/testReport)** for PR 18003 at commit [`1450dd1`](https://github.com/apache/spark/commit/1450dd1a2e43e81afd35ba7fefcfbe8834b5c198).
     * 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