Github user aray commented on a diff in the pull request:
https://github.com/apache/spark/pull/7841#discussion_r44352381
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/DataFrame.scala ---
@@ -989,6 +989,41 @@ class DataFrame private[sql](
}
/**
+ * (Scala-specific) Pivots a column of the current [[DataFrame]] and
preform the specified
+ * aggregation.
+ * {{{
+ * // Compute the sum of earnings for each year by course with each
course as a separate column.
+ * df.pivot(Seq($"year"), $"course", Seq("dotNET", "Java"),
sum($"earnings"))
+ * }}}
+ * @param groupBy Columns to group by.
+ * @param pivotColumn Column to pivot
+ * @param pivotValues Values of pivotColumn that will be translated to
columns in the output data
+ * frame.
+ * @param aggregate Aggregate expression to preform for each combination
of groupBy and
+ * pivotValues.
+ * @group dfops
+ * @since 1.6.0
+ */
+ def pivot(
--- End diff --
sure
---
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]