Is your feature request related to a problem or challenge?
Discussion thread
The WindowTopN physical optimizer rule currently skips FilterExec nodes that have an embedded projection (filter.projection().is_some()). This happens when ProjectionPushdown runs before WindowTopN and embeds a projection into the FilterExec.
// Don't handle filters with projections
if filter.projection().is_some() {
return None;
}
Describe the solution you'd like
Extend WindowTopN to handle FilterExec with embedded projections. This would require:
- Extracting the projection mapping from FilterExec
- Resolving the window column index through the projection (mapping projected column indices back to the original schema)
- Carrying the projection forward into the replacement plan (either re-wrapping PartitionedTopKExec with a ProjectionExec, or embedding the projection)
Describe alternatives you've considered
No response
Additional context
No response
Is your feature request related to a problem or challenge?
Discussion thread
The
WindowTopNphysical optimizer rule currently skipsFilterExecnodes that have an embedded projection (filter.projection().is_some()). This happens whenProjectionPushdownruns beforeWindowTopNand embeds a projection into theFilterExec.Describe the solution you'd like
Extend WindowTopN to handle FilterExec with embedded projections. This would require:
Describe alternatives you've considered
No response
Additional context
No response