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


##########
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:
   @rxin Given Wenchen is against the idea and there is little we can do for 
future-proofing, do you mind matching the aggregation PythonUDF in 
https://github.com/apache/spark/pull/39134 instead of adding this node pattern?



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