Github user lins05 commented on a diff in the pull request:
https://github.com/apache/spark/pull/15487#discussion_r83551685
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Last.scala
---
@@ -29,15 +29,18 @@ import org.apache.spark.sql.types._
* a single partition, and we use a single reducer to do the aggregation.).
*/
@ExpressionDescription(
- usage = "_FUNC_(expr,isIgnoreNull) - Returns the last value of `child`
for a group of rows.")
+ usage = """_FUNC_(expr,isIgnoreNull) - Returns the last value of `child`
for a group of rows.
+ _FUNC_(expr,isIgnoreNull=false) - Returns the last value of `child`
for a group of rows.
--- End diff --
@hvanhovell @HyukjinKwon Thanks for the review. I'm simply following the
usage string of other functions, e.g:
```
spark-sql> describe function first;
Function: first
Class: org.apache.spark.sql.catalyst.expressions.aggregate.First
Usage: first(expr) - Returns the first value of `child` for a group of rows.
first(expr,isIgnoreNull=false) - Returns the first value of `child` for
a group of rows.
If isIgnoreNull is true, returns only non-null values.
spark-sql> describe function approx_count_distinct;
Function: approx_count_distinct
Class:
org.apache.spark.sql.catalyst.expressions.aggregate.HyperLogLogPlusPlus
Usage: approx_count_distinct(expr) - Returns the estimated cardinality by
HyperLogLog++.
approx_count_distinct(expr, relativeSD=0.05) - Returns the estimated
cardinality by HyperLogLog++
with relativeSD, the maximum estimation error allowed.
```
So it seems the current convention is that: the first line is a short
one-line description, followed by a detail description. Do we have any explicit
"usage string style" to follow?
@hvanhovell I'll add the note about nondeterministic.
---
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]