kosiew commented on code in PR #24720:
URL: https://github.com/apache/datafusion/pull/24720#discussion_r3903780289


##########
datafusion/optimizer/src/extract_leaf_expressions.rs:
##########
@@ -1215,6 +1288,15 @@ fn try_push_into_inputs(
         if per_input[idx].pairs.is_empty() {
             new_inputs.push(input.clone());
         } else {
+            // Merging into an input projection inlines the referenced columns'
+            // definitions; bail out when that would duplicate a volatile
+            // computation.
+            if would_duplicate_volatile(

Review Comment:
   Could we add a join-side regression test for this routed-input guard? The 
current tests cover the pass-1 and direct-projection paths, but not the case 
where a projection above a join routes `s['a']` into one join input that is 
itself `SELECT named_struct('a', random()) AS s`. An execution assertion 
checking that the extracted value equals that side's `s['a']` would give us 
coverage for this distinct call site. This is non-blocking.



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