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

   ### Describe the bug
   
   The current implementation of optimize using transform_up approach, which 
lacked context awareness regarding ancestor nodes. As a result, running the 
optimizer rule multiple times will produce nested CooperativeExec wrappers.
   
   
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   1. Idempotency: Running the rule multiple times does not produce nested 
CooperativeExec wrappers (e.g., Coop(Coop(Scan))).
   
   2. Context Awareness: If a subtree is already protected by a CooperativeExec 
(e.g., from a previous optimization pass or manual plan construction), we 
should not double-wrap its children.
   
   ### 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