spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From felixcheung <...@git.apache.org>
Subject [GitHub] spark pull request #15343: [SPARK-8480] [CORE] [PYSPARK] [SPARKR] Add setNam...
Date Tue, 04 Oct 2016 23:44:21 GMT
Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15343#discussion_r81877210
  
    --- Diff: R/pkg/R/DataFrame.R ---
    @@ -65,6 +65,49 @@ dataFrame <- function(sdf, isCached = FALSE) {
     
     ############################ SparkDataFrame Methods ##############################################
     
    +#' Return an SparkDataFrame's name.
    +#'
    +#' @param x The SparkDataFrame whose name is returned.
    +#' @rdname name
    +#' @examples
    +#'\dontrun{
    +#' sparkR.session()
    +#' path <- "path/to/file.json"
    +#' df <- read.json(path)
    +#' df.name()
    +#'}
    +#' @aliases name,SparkDataFrame-method
    +#' @noRd
    +#' @note explain since 2.1.0
    +setMethod("name",
    +          signature(x = "SparkDataFrame"),
    +          function(x) {
    +            callJMethod(x@sdf, "name")
    +          })
    +
    +#' Set an SparkDataFrame's name.
    +#'
    +#' @param x The SparkDataFrame whose name is to be set.
    +#' @param name The SparkDataFrame name to be set.
    +#' @return a new SparkDataFrame renamed.
    +#' @rdname setName
    --- End diff --
    
    instead of `name` and `setName`, generally it is more R-like to have a setter function
- you can see an example at L310 `setMethod("names<-",`
    
    in such a case, it would be better to put both onto the same page by having the same `#'
@rdname name` tag


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


Mime
View raw message