Github user NarineK commented on a diff in the pull request:
https://github.com/apache/spark/pull/12887#discussion_r61991037
--- Diff: R/pkg/R/DataFrame.R ---
@@ -594,6 +594,35 @@ setMethod("repartition",
dataFrame(sdf)
})
+#' RepartitionByColumn
+#'
+#' Return a new SparkDataFrame which has as many partitions as the number
of unique
+#' groups identified by column(s) values which are being specified by the
input.
+#'
+#' @param x A SparkDataFrame
+#' @param col The column by which the partitioning will be performed
+#'
+#' @family SparkDataFrame functions
+#' @rdname repartition
+#' @name repartition
+#' @export
+#' @examples
+#'\dontrun{
+#' sc <- sparkR.init()
+#' sqlContext <- sparkRSQL.init(sc)
+#' path <- "path/to/file.json"
+#' df <- read.json(sqlContext, path)
+#' newDF <- repartitionByColumn(df, df$col1, df$col2)
+#'}
+setMethod("repartitionByColumn",
--- End diff --
Yes, it is one of the possible options.
We are not forcing by signature, but we have to do some checks instead.
Whichever you prefer, I'm fine with it too.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]