rxin commented on code in PR #39142:
URL: https://github.com/apache/spark/pull/39142#discussion_r1054854838


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/PythonUDF.scala:
##########
@@ -64,7 +68,17 @@ case class PythonUDF(
 
   override def toString: String = s"$name(${children.mkString(", 
")})#${resultId.id}$typeSuffix"
 
-  final override val nodePatterns: Seq[TreePattern] = Seq(PYTHON_UDF)
+  // SPARK-41633: We should check whether to update the node patterns when 
adding a new eval type.
+  private def nodePatternsOfPythonFunction: Seq[TreePattern] = {
+    if (PythonUDF.isGroupedAggPandasUDFEvalType(evalType)) {
+      Seq(AGGREGATE_EXPRESSION)

Review Comment:
   I agree that we should have a subtype for aggregate. That's a much safer 
change. Should've done that from the beginning IMO.
   



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