Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16668#discussion_r98112875
  
    --- Diff: R/pkg/R/DataFrame.R ---
    @@ -3406,3 +3406,28 @@ setMethod("randomSplit",
                 }
                 sapply(sdfs, dataFrame)
               })
    +
    +#' getNumPartitions
    +#'
    +#' Return the number of partitions
    +#' Note: in order to compute the number of partition the SparkDataFrame 
has to be converted into a
    +#' RDD temporarily internally.
    +#'
    +#' @param x A SparkDataFrame
    +#' @family SparkDataFrame functions
    +#' @aliases getNumPartitions,SparkDataFrame-method
    +#' @rdname getNumPartitions
    +#' @name getNumPartitions
    +#' @export
    +#' @examples
    +#'\dontrun{
    +#' sparkR.session()
    +#' df <- createDataFrame(cars, numPartitions = 2)
    +#' getNumPartitions(df)
    +#' }
    +#' @note getNumPartitions since 2.1.1
    +setMethod("getNumPartitions",
    +          signature(x = "SparkDataFrame"),
    +          function(x) {
    +            callJMethod(callJMethod(x@sdf, "rdd"), "getNumPartitions")
    --- End diff --
    
    so rxin is saying on #16708 that we don't want this to be a public API on 
Dataset. I'm leaving this for now since this implementation seems reasonably 
low overhead.
    
    perhaps @shivaram and @cloud-fan want to comment in #16708?


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

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

Reply via email to