nat-openai opened a new issue, #7466:
URL: https://github.com/apache/datafusion-comet/issues/7466

   ### What is the problem the feature request solves?
   
   Comet executes ROW_NUMBER through DataFusion’s generic BoundedWindowAggExec. 
That executor creates partition keys, slices batches and maintains evaluation 
state for each PARTITION BY group.
   
   This bookkeeping is expensive when a query has many groups containing only 
one or a few rows. ROW_NUMBER needs only a counter and partition-boundary 
detection, so a simpler execution path could substantially reduce CPU and 
allocation overhead.
   
   ### Describe the potential solution
   
   The approach I've been experimenting with is to add a specialised executor 
for sorted windows containing only built-in ROW_NUMBER expressions with 
matching partition and ordering keys. The specialised implementation can 
benefit from reusing input columns and sharing the generated rank array between 
repeated expressions.
   
   Other window shapes would continue using the generic executor.
   
   ### Additional context
   
   - [DataFusion #26541](https://github.com/apache/datafusion/issues/26541) 
describes the underlying per-partition overhead. The Comet specialisation can 
be reassessed when upstream improvements provide comparable behaviour and 
performance.
   - Generic bounded-window memory accounting is tracked separately in [Comet 
#7092](https://github.com/apache/datafusion-comet/issues/7092).
   
   ### Willingness to contribute
   
   I can contribute a fix for this bug independently


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