Skip to content

Commit 80e8df1

Browse files
committed
[SPARK-42259][SQL] ResolveGroupingAnalytics should take care of Python UDAF
This is a long-standing correctness issue with Python UDAF and grouping analytics. The rule `ResolveGroupingAnalytics` should take care of Python UDAF when matching aggregate expressions. bug fix Yes, the query result was wrong before existing tests Closes #39824 from cloud-fan/python. Authored-by: Wenchen Fan <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 1219c84) Signed-off-by: Wenchen Fan <[email protected]>
1 parent 0bb8f22 commit 80e8df1

File tree

1 file changed

+1
-1
lines changed
  • sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis

1 file changed

+1
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ class Analyzer(override val catalogManager: CatalogManager)
617617
// AggregateExpression should be computed on the unmodified value of its argument
618618
// expressions, so we should not replace any references to grouping expression
619619
// inside it.
620-
case e: AggregateExpression =>
620+
case e if AggregateExpression.isAggregate(e) =>
621621
aggsBuffer += e
622622
e
623623
case e if isPartOfAggregation(e) => e

0 commit comments

Comments
 (0)