zml1206 commented on code in PR #57815:
URL: https://github.com/apache/spark/pull/57815#discussion_r3763009852


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowEvaluatorFactoryBase.scala:
##########
@@ -169,6 +183,9 @@ trait WindowEvaluatorFactoryBase {
         case e@WindowExpression(function, spec) =>
           val frame = 
spec.frameSpecification.asInstanceOf[SpecifiedWindowFrame]
           function match {
+            case ae @ AggregateExpression(_, _, true, _, _)
+                if frame.lower == UnboundedPreceding =>
+              collect("DISTINCT_AGGREGATE", frame, e, ae)

Review Comment:
   Agreed. I moved both the DISTINCT child extraction and the complete support 
predicate into shared helpers under WindowExpression. WindowResolution and 
physical frame routing now use the same predicate, including the Python UDAF, 
lower-bound, and orderability checks.
   I also added an explicit physical-planning failure for any remaining 
DISTINCT aggregate, so future predicate drift fails loudly instead of falling 
through to the non-distinct aggregate path and silently dropping isDistinct.



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