diff options
author | Wenchen Fan <cloud0fan@outlook.com> | 2015-04-29 09:49:24 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-04-29 09:49:24 -0700 |
commit | 81ea42bf39db7366e266bc1e5ce7e459fa2ef409 (patch) | |
tree | 09dc690d8688668b55717fadd5d8c528ef11d3e8 /sql/core | |
parent | 3df9c5dd0ce9ce82f9029c2846ad2f6164c501f3 (diff) | |
download | spark-81ea42bf39db7366e266bc1e5ce7e459fa2ef409.tar.gz spark-81ea42bf39db7366e266bc1e5ce7e459fa2ef409.tar.bz2 spark-81ea42bf39db7366e266bc1e5ce7e459fa2ef409.zip |
[SQL][Minor] fix java doc for DataFrame.agg
Author: Wenchen Fan <cloud0fan@outlook.com>
Closes #5712 from cloud-fan/minor and squashes the following commits:
be23064 [Wenchen Fan] fix java doc for DataFrame.agg
Diffstat (limited to 'sql/core')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala b/sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala index 2affba7d42..0e896e5693 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala @@ -623,17 +623,12 @@ class DataFrame private[sql]( } /** - * (Scala-specific) Compute aggregates by specifying a map from column name to - * aggregate methods. The resulting [[DataFrame]] will also contain the grouping columns. - * - * The available aggregate methods are `avg`, `max`, `min`, `sum`, `count`. - * {{{ - * // Selects the age of the oldest employee and the aggregate expense for each department - * df.groupBy("department").agg( - * "age" -> "max", - * "expense" -> "sum" - * ) - * }}} + * (Scala-specific) Aggregates on the entire [[DataFrame]] without groups. + * {{ + * // df.agg(...) is a shorthand for df.groupBy().agg(...) + * df.agg("age" -> "max", "salary" -> "avg") + * df.groupBy().agg("age" -> "max", "salary" -> "avg") + * }} * @group dfops */ def agg(aggExpr: (String, String), aggExprs: (String, String)*): DataFrame = { |