pavan51 commented on code in PR #57346:
URL: https://github.com/apache/spark/pull/57346#discussion_r3626353141


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowEvaluatorFactoryBase.scala:
##########
@@ -281,7 +283,19 @@ trait WindowEvaluatorFactoryBase {
 
           // Shrinking Frame.
           case ("AGGREGATE", frameType, lower, UnboundedFollowing, _) =>
-            if (eligibleForSegTree(functions, aggFilters, frameType, conf)) {
+            val isMinMaxOnly = conf.windowMonotonicDequeEnabled &&
+              functions.nonEmpty && functions.forall {
+                case _: Min | _: Max => true
+                case _ => false
+              } && aggFilters.forall(_.isEmpty)

Review Comment:
   Done. I've refactored this and pulled  isMinMaxOnly  up to the outer scope 
of the match block so it is cleanly shared by both the moving and shrinking 
frame cases.



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