Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/21752#discussion_r204883667
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/RelationalGroupedDataset.scala ---
@@ -470,8 +470,11 @@ class RelationalGroupedDataset protected[sql](
override def toString: String = {
val builder = new StringBuilder
builder.append("RelationalGroupedDataset: [grouping expressions: [")
- val kFields = groupingExprs.map(_.asInstanceOf[NamedExpression]).map {
- case f => s"${f.name}: ${f.dataType.simpleString(2)}"
+ val kFields = groupingExprs.collect {
+ case expr: NamedExpression if expr.resolved =>
+ s"${expr.name}: ${expr.dataType.simpleString(2)}"
+ case expr: NamedExpression =>
+ expr.name
--- End diff --
We need the same fix in `KeyValueGroupedDataset`. Could you help us do it?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]