Repository navigation
Revert "Revert "Convert OUTER join to INNER join by null-rejecting join conditions" again" - #120130
alexey-milovidov wants to merge 1 commit into
Conversation
…g join conditions" again"
|
Workflow [PR], commit [f1c1543] Summary: ❌
AI ReviewSummaryThis revert re-enables deriving planner-only Findings❌ Blockers
Final VerdictStatus: Minimum required actions:
LLVM Coverage ReportMeasured on commit f1c1543.
Changed lines: Changed C/C++ lines covered: 318/337 (94.36%) · Uncovered code |
| for (const auto * input : dag.getInputs()) | ||
| { | ||
| if (!columns.contains(input->result_name)) | ||
| continue; | ||
|
|
||
| const auto & is_not_null_node = dag.addFunction(is_not_null, {input}, {}); | ||
| conjuncts.push_back(&dag.addFunction(derived_filter_marker, {&is_not_null_node}, {})); |
There was a problem hiding this comment.
This derivation is keyed only by result_name: collectColumnsThroughNullPropagatingFunctions stores candidate inputs in a NameSet, and this loop then adds isNotNull to every child-header input with the matching name.
That is not safe here. Query-plan headers can legitimately carry duplicate names on one side of a join, and nearby optimizations in this subsystem already treat name-based rewrites as ambiguous for that reason (JoinStepLogical::canRemoveUnusedColumns, joinRuntimeFilter.cpp, pushDownVolumeReducingFunctions.cpp). If the null-rejecting predicate only proves one specific nullable input non-NULL, this code will also filter any unrelated duplicate column with the same name, which can drop rows and make the later OUTER -> INNER conversion incorrect.
Please key the derived filters by input identity/position end-to-end, or conservatively bail out when the child header duplicates one of the candidate names.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes922 object files changed (+475.62 KiB total), 3 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
|
@alexey-milovidov I re-implemented the same improvement with a completely different approach that will be less error prone #120253 (no more derived filter floating around that can affect other plan steps). So I will close this one for now. |
Reverts #120119
Workflow [PR]
Sync PR [sync-upstream/pr/120130]