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


##########
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:
   > Even if we fix the node pattern here, 
expr.exists(_.isInstanceOf[AggregateExpression]) is still broken.
   
   I am not getting your point about this one. Can you explain it?



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