hvanhovell commented on code in PR #40070:
URL: https://github.com/apache/spark/pull/40070#discussion_r1110385162


##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/RelationalGroupedDataset.scala:
##########
@@ -109,7 +109,7 @@ class RelationalGroupedDataset protected[sql] (
     agg(exprs.asScala.toMap)
   }
 
-  private[this] def strToExpr(expr: String, inputExpr: proto.Expression): 
proto.Expression = {
+  private[this] def strToColumn(expr: String, inputExpr: proto.Expression): 
Column = {

Review Comment:
   How about:
   ```scala
   private[this] def strToColumn(expr: String, inputExpr: Column): Column = {
     expr.toLowerCase(Locale.ROOT) match {
       case "avg" | "average" | "mean" => functions.avg(inputExpr)
       case "stddev" | "std" => functions.avg(inputExpr)
       case "count" | "size" => functions.count(inputExpr) // Analyzer will 
take care of * expansion
       case name => Column.fn(name, inputExpr)
     }
   }
   ```



-- 
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]

Reply via email to