Github user davies commented on a diff in the pull request:
https://github.com/apache/spark/pull/9446#discussion_r43813023
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/GroupedData.scala ---
@@ -316,86 +264,48 @@ class GroupedData protected[sql](
}
/**
- * Compute the sample standard deviation for each numeric columns for
each group.
+ * Compute the sum for each numeric columns for each group.
* The resulting [[DataFrame]] will also contain the grouping columns.
- * When specified columns are given, only compute the stddev for them.
+ * When specified columns are given, only compute the sum for them.
*
- * @since 1.6.0
+ * @since 1.3.0
*/
@scala.annotation.varargs
- def stddev(colNames: String*): DataFrame = {
- aggregateNumericColumns(colNames : _*)(Stddev)
+ def sum(colNames: String*): DataFrame = {
+ aggregateNumericColumns(colNames : _*)(Sum)
}
+}
- /**
- * Compute the population standard deviation for each numeric columns
for each group.
- * The resulting [[DataFrame]] will also contain the grouping columns.
- * When specified columns are given, only compute the stddev for them.
- *
- * @since 1.6.0
- */
- @scala.annotation.varargs
- def stddev_pop(colNames: String*): DataFrame = {
- aggregateNumericColumns(colNames : _*)(StddevPop)
- }
- /**
- * Compute the sample standard deviation for each numeric columns for
each group.
- * The resulting [[DataFrame]] will also contain the grouping columns.
- * When specified columns are given, only compute the stddev for them.
- *
- * @since 1.6.0
- */
- @scala.annotation.varargs
- def stddev_samp(colNames: String*): DataFrame = {
- aggregateNumericColumns(colNames : _*)(StddevSamp)
+/**
+ * Companion object for GroupedData.
+ */
+private[sql] object GroupedData {
+
+ def apply(
+ df: DataFrame,
+ groupingExprs: Seq[Expression],
+ groupType: GroupType): GroupedData = {
+ new GroupedData(df, groupingExprs, groupType: GroupType)
}
/**
- * Compute the sum for each numeric columns for each group.
- * The resulting [[DataFrame]] will also contain the grouping columns.
- * When specified columns are given, only compute the sum for them.
- *
- * @since 1.3.0
+ * The Grouping Type
*/
- @scala.annotation.varargs
- def sum(colNames: String*): DataFrame = {
--- End diff --
We can't remove this, it's introduced in 1.3
---
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]