hvanhovell commented on code in PR #40796:
URL: https://github.com/apache/spark/pull/40796#discussion_r1183900469
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -1867,7 +1928,34 @@ class SparkConnectPlanner(val session: SparkSession) {
output.logicalPlan
}
+ def transformKeyValueGroupedAggregate(rel: proto.Aggregate): LogicalPlan = {
+ val ds = UntypedKeyValueGroupedDataset(
+ rel.getInput,
+ rel.getGroupingExpressionsList,
+ java.util.Collections.emptyList())
+
+ val namedColumns = rel.getAggregateExpressionsList.asScala.toSeq.map(expr
=> {
+ // Use any encoder as a placeholder to perform the
TypedColumn#withInputType transformation
+ val any = ds.vEncoder
+ val newExpr = new TypedColumn(transformExpression(expr), any)
+ .withInputType(ds.vEncoder, ds.dataAttributes)
+ .expr
+ Column(newExpr).named
Review Comment:
Can we just put the named functionality in a separate util function instead
of creating a Typed column here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]