beliefer commented on code in PR #44145: URL: https://github.com/apache/spark/pull/44145#discussion_r1418226850
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/InferWindowGroupLimit.scala: ########## @@ -68,10 +72,57 @@ object InferWindowGroupLimit extends Rule[LogicalPlan] with PredicateHelper { case _ => false } + private def limitSupport(limit: Int, window: Window): Boolean = + limit <= conf.windowGroupLimitThreshold && window.child.maxRows.forall(_ > limit) && + !window.child.isInstanceOf[WindowGroupLimit] && + window.windowExpressions.forall(isExpandingWindow) && + window.orderSpec.exists(!_.foldable) && + // LimitPushDownThroughWindow have better performance than WindowGroupLimit if the + // window function is Rank, DenseRank and RowNumber, and Window partitionSpec is empty. + !(window.partitionSpec.isEmpty && supportsPushdownThroughWindow(window.windowExpressions) && Review Comment: Could you give an example? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org