kgyrtkirk commented on PR #15694:
URL: https://github.com/apache/druid/pull/15694#issuecomment-1905364635

   @clintropolis I don't fully understand how the suggested `Supplier` based 
solution should work in this case - could you please expand on that idea a bit 
more?
   
   I think another way could be to make a full clone of the whole tree 
unconditionally - which kinda already happens due to the current change; let me 
explain:
   * we have a tree of `Expr` objects
   * the `ConstExpr` objects are mutated by the `#singleThreaded` method - so 
they change
   * since the tree is on `Expr` objects; a nested `ConstExpr` change will 
implicitly clones all its parents
   * as a result: all expr nodes are cloned which have at least 1 `ConstExpr` 
beneath it
   * this would differ from the current PR content with:
      * change the name of method from `#singleThreaded` to `#clone` 
      * could retain a less complicated logic
   
   Another way we could tackle this is by placing the `ExprEval` into a 
ThreadLocal
   
   ...and all the previous approach; which way should we go?


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