comphead commented on code in PR #26013:
URL: https://github.com/apache/datafusion/pull/26013#discussion_r4338631913


##########
datafusion/optimizer/src/decorrelate.rs:
##########
@@ -664,6 +674,16 @@ impl TreeNodeRewriter for PullUpCorrelatedExpr {
                         .iter()
                         .all(|expr| partitions_by_all(expr, 
&local_correlated_cols))
                 {
+                    // `inner.y = outer.k` keeps the rows of one `y` value for
+                    // each outer row, so partitioning by `y` as well gives 
each
+                    // window function the same rows. A window over an
+                    // aggregate with count bug handling stops the pull up in
+                    // `pass_through_pulled_up_cols`.
+                    if self.can_extend_partition_by {

Review Comment:
   Thanks @kumarUjjawal the rabbit hole is going deeper, makes me thinks we 
need to improve test coverage



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