SubhamSinghal commented on code in PR #26133:
URL: https://github.com/apache/datafusion/pull/26133#discussion_r4241702363
##########
datafusion/physical-optimizer/src/window_topn.rs:
##########
@@ -233,19 +246,47 @@ impl WindowTopN {
return None;
}
- let partitioned_topk = PartitionedTopKExec::try_new(
+ // The operator can emit the ranking column itself, which makes the
+ // `BoundedWindowAggExec` above it redundant — see step 7. All three
+ // ranking functions are derivable from the retained set as it is
+ // emitted (`PartitionedTopKExec` documents how per policy), so the
only
+ // condition is that there is exactly one window expression: the
+ // operator appends a single column, and it has to reproduce the whole
+ // of the window node's output schema. With two or more the window node
+ // stays and computes them as before.
+ let ranking_field = if window_exprs.len() == 1 {
Review Comment:
Addressed in
[a3f5e79](https://github.com/apache/datafusion/pull/26133/commits/a3f5e793d707dd60fa1f80d4c6ca5cf7c728951d)
--
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]