dongjoon-hyun commented on a change in pull request #23756: [SPARK-26853][SQL] 
Add example and version for commonly used aggregate function descriptions
URL: https://github.com/apache/spark/pull/23756#discussion_r255318954
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Average.scala
 ##########
 @@ -24,7 +24,15 @@ import org.apache.spark.sql.catalyst.util.TypeUtils
 import org.apache.spark.sql.types._
 
 @ExpressionDescription(
-  usage = "_FUNC_(expr) - Returns the mean calculated from values of a group.")
+  usage = "_FUNC_(expr) - Returns the mean calculated from values of a group.",
+  examples = """
+    Examples:
+      > SELECT _FUNC_(col) FROM VALUES (1), (2), (3) AS tab(col);
+       2.0
+      > SELECT _FUNC_(col) FROM VALUES (1), (2), (NULL) AS tab(col);
+       1.5
+  """,
+  since = "1.3.0")
 
 Review comment:
   @dilipbiswal . This is `1.0.0`. Please see [SPARK-1251 
](https://issues.apache.org/jira/browse/SPARK-1251).
   ```scala
   scala> sc.version
   res15: String = 1.0.0
   
   scala> sqlContext.sql("SELECT avg(age) FROM people WHERE age >= 13 AND age 
<= 19").collect
   res14: Array[org.apache.spark.sql.Row] = Array([19.0])
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]

Reply via email to