Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/15513#discussion_r84604637
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentile.scala
---
@@ -49,21 +49,29 @@ import org.apache.spark.sql.types._
* DEFAULT_PERCENTILE_ACCURACY.
*/
@ExpressionDescription(
- usage =
- """
- _FUNC_(col, percentage [, accuracy]) - Returns the approximate
percentile value of numeric
+ usage = """
+ _FUNC_(col, percentage [, accuracy]) - Returns the approximate
percentile value of numeric
column `col` at the given percentage. The value of percentage must
be between 0.0
and 1.0. The `accuracy` parameter (default: 10000) is a positive
integer 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.
-
- _FUNC_(col, array(percentage1 [, percentage2]...) [, accuracy]) -
Returns the approximate
- percentile array of column `col` at the given percentage array. Each
value of the
- percentage array must be between 0.0 and 1.0. The `accuracy`
parameter (default: 10000) is
- a positive integer 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.
- """)
+ When percentage is an array, each value of the percentage array must
be between 0.0 and 1.0.
+ In this case, returns the approximate percentile array of column
`col` at the given
+ percentage array.
+ """,
+ extended = """
+ Arguments:
+ col - a numeric expression.
+ percentage - a numeric literal or an array literal of numeric type
that defines the
+ percentile between 0.0 and 1.0. For example, 0.5 means
50-percentile.
+ accuracy - a numeric literal that defines approximation accuracy.
--- End diff --
expression takes both value and column where as literal takes value only in
general. (It throws an exception when a column is given instead).
---
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]