HyukjinKwon commented on a change in pull request #27278:
[SPARK-30569][SQL][PYSPARK][SPARKR] Add percentile_approx DSL functions.
URL: https://github.com/apache/spark/pull/27278#discussion_r368345690
##########
File path: R/pkg/R/functions.R
##########
@@ -1332,6 +1332,48 @@ setMethod("quarter",
column(jc)
})
+#' @details
+#' \code{percentile_approx} Returns the approximate percentile value of
+#' numeric column at the given percentage.
+#'
+#' @param percentage numeric percentage at which percentile should be computed
+#' All values should be between 0 and 1.
+#' If length equals to 1 resulting column is of type double,
+#' otherwise array<double>/
+#' @param accuracy parameter (default: 10000) is a positive numeric literal
which
+#' controls approximation accuracy at the cost of memory. Higher value of
accuracy
+#' yields better accuracy, 1.0/accuracy is the relative error of the
approximation.
+#'
+#' @rdname column_aggregate_functions
+#' @aliases percentile_approx percentile_approx,Column-method
+#' @note percentile_approx since 3.0.0
+setMethod("percentile_approx",
+ signature(x = "characterOrColumn", percentage = "numeric", accuracy
= "numeric"),
+ function(x, percentage, accuracy) {
Review comment:
This way is more consistent and you can only define one method.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]