Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/18307#discussion_r125146093
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ---
@@ -2205,37 +2205,151 @@ class Dataset[T] private[sql](
* // max 92.0 192.0
* }}}
*
+ * See also [[summary]]
+ *
+ * @param cols Columns to compute statistics on.
+ *
* @group action
* @since 1.6.0
*/
@scala.annotation.varargs
- def describe(cols: String*): DataFrame = withPlan {
+ def describe(cols: String*): DataFrame = {
+ val selected = if (cols.isEmpty) this else select(cols.head,
cols.tail: _*)
+ selected.summary("count", "mean", "stddev", "min", "max")
+ }
+
+ /**
+ * Computes specified statistics for numeric and string columns.
Available statistics are:
--- End diff --
I'd also give an example of how to compute summary for specific columns.
---
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]