jaideeppyne commented on code in PR #24720:
URL: https://github.com/apache/datafusion/pull/24720#discussion_r3905927400
##########
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:
Added in e07285a. The new sqllogictest covers the projection-above-join
route where the left input materializes `named_struct(a, random()) AS s` and
the outer projection extracts `l.s[a]`; it asserts `bool_and(field = s[a])`, so
the extracted value must come from that join side’s materialized struct rather
than a duplicate volatile evaluation.
Validation:
- `cargo test -p datafusion-optimizer extract_leaf_expressions --lib`
- `cargo test --test sqllogictests -- projection_pushdown`
--
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]