namanjain24-sudo commented on PR #25781:
URL: https://github.com/apache/datafusion/pull/25781#issuecomment-6224621988

   Applied this, thanks — went with push/pop in `f_down`/`f_up` like you 
showed. Ran the full slt suite, all 941 `datafusion-optimizer` unit tests, 
clippy and fmt, all clean.
   
   One thing I had to add beyond your diff: the `Limit` branch for EXISTS 
re-enters `f_down` manually on `limit.input` (comment there: "the rewriter does 
not call f_down on the returned node, so do it here") instead of going through 
the normal child recursion. With a plain top-of-`f_down` push, that path pushes 
two entries for one tree position — the `Limit`'s own and then `limit.input`'s 
— but only one `f_up` call reaches that position afterward, since `Limit` gets 
dropped. Turns out harmless in practice (`Limit`'s own `expressions()` are 
`skip`/`fetch`, and this branch only runs when both are literals, so the leaked 
entry is always empty — no observable bug), but I popped the `Limit`'s own 
entry before delegating anyway so the stack stays honest rather than relying on 
that being empty forever. Pushed as a separate concern in case you want to look 
at it specifically.
   


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