avantgardnerio opened a new issue, #18028:
URL: https://github.com/apache/datafusion/issues/18028

   ### Describe the bug
   
   Some analytical functions effect the effective window bounds by adding a 
lookahead (acausal) amount of rows. The current implementation of 
`LimitPushPastWindows` does not take this into account, does not grow the limit 
by the appropriate amount, and does not give them the input data necessary to 
compute the correct totals.
   
   ### To Reproduce
   
   Run a query like:
   
   ```
   SELECT LEAD(empno) OVER (ORDER BY empno ROWS BETWEEN UNBOUNDED PRECEDING AND 
CURRENT ROW) FROM employees LIMIT 3
   ```
   
   with `datafusion.optimizer.enable_window_limits` enabled/disabled to observe 
different results.
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


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