pepijnve commented on code in PR #18329:
URL: https://github.com/apache/datafusion/pull/18329#discussion_r2475635090


##########
datafusion/physical-expr/src/expressions/case.rs:
##########
@@ -46,13 +48,13 @@ enum EvalMethod {
     ///      [WHEN ...]
     ///      [ELSE result]
     /// END
-    NoExpression,
+    NoExpression(ProjectedCaseBody),

Review Comment:
   In theory yes, in practice no. `with_new_children` calls `CaseExpr::try_new` 
which will derive a new projected version. So at least through the public API 
there's no way to get the two out of sync.
   
   I wanted to avoid that case would silently rewrite the externally visible 
expressions. The projected variant may not match the schema of the execution 
plan anymore so I felt it would be a bad idea to let this leak out.
   
   I need to keep the rewritten version somewhere in order to evaluate it so I 
ended up putting that in the `EvalMethod`s that would actually make use of it.
   
   That being said, I'm not entirely happy with this solution myself either. 
It's the best I could come up with that completely hides what's going on from 
the outside world.



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