Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/19363#discussion_r144753173
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/RelationalGroupedDataset.scala ---
@@ -465,6 +466,19 @@ class RelationalGroupedDataset protected[sql](
Dataset.ofRows(df.sparkSession, plan)
}
+
+ override def toString: String = {
+ val builder = new StringBuilder
+ builder.append("RelationalGroupedDataset: [groupingBy: [")
+ val kFields = groupingExprs.map(_.asInstanceOf[NamedExpression]).map {
+ case f => s"${f.name}: ${f.dataType.simpleString(2)}"
+ }
+ builder.append(kFields.take(2).mkString(", "))
+ if (kFields.length > 2) {
+ builder.append(" ... " + (kFields.length - 2) + " more field(s)")
+ }
+ builder.append(s"], df: ${df.toString}, type: $groupType]").toString()
--- End diff --
why include `df` here?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]