Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/19872#discussion_r154644235
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/RelationalGroupedDataset.scala ---
@@ -437,6 +437,37 @@ class RelationalGroupedDataset protected[sql](
df.logicalPlan))
}
+
+ private[sql] def aggInPandas(columns: Seq[Column]): DataFrame = {
+ val exprs = columns.map(column => column.expr.asInstanceOf[PythonUDF])
+
+ val groupingNamedExpressions = groupingExprs.map {
+ case ne: NamedExpression => ne
+ case other => Alias(other, other.toString)()
+ }
+
+ val groupingAttributes = groupingNamedExpressions.map(_.toAttribute)
+
+ val child = df.logicalPlan
+
+ val childrenExpressions = exprs.flatMap(expr =>
+ expr.children.map {
+ case ne: NamedExpression => ne
+ case other => Alias(other, other.toString)()
--- End diff --
indentation nit
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]