Github user jnh5y commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16329#discussion_r93262242
  
    --- Diff: docs/sql-programming-guide.md ---
    @@ -382,6 +382,52 @@ For example:
     
     </div>
     
    +## Aggregations
    +
    +The [built-in DataFrames 
functions](api/scala/index.html#org.apache.spark.sql.functions$) mentioned 
    +before provide such common aggregations as `count()`, `countDistinct()`, 
`avg()`, `max()`, `min()`, etc.
    +While those functions are designed for DataFrames, Spark SQL also has 
type-safe versions for some of them in 
    
+[Scala](api/scala/index.html#org.apache.spark.sql.expressions.scalalang.typed$)
 and 
    +[Java](api/java/org/apache/spark/sql/expressions/javalang/typed.html) to 
work with strongly typed Datasets.
    +Moreover, users are not limited to the predefined aggregate functions and 
can create their own.
    --- End diff --
    
    I think it'd be worth showing an Spark SQL example using the 
included/pre-defined functions.  Since your example implements 'avg', maybe use 
'min' / 'max'?
    
    Alternatively, the example could be added to the SQL statements in the main 
driver for the UserDefinedAggregateFunction implementations.  


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to