Conversation
Unrelated
Unrelated
Unrelated |
src/Processors/QueryPlan/Optimizations/mergeFilterIntoJoinCondition.cpp
Outdated
Show resolved
Hide resolved
src/Processors/QueryPlan/Optimizations/mergeFilterIntoJoinCondition.cpp
Outdated
Show resolved
Hide resolved
src/Processors/QueryPlan/Optimizations/mergeFilterIntoJoinCondition.cpp
Outdated
Show resolved
Hide resolved
src/Processors/QueryPlan/Optimizations/mergeFilterIntoJoinCondition.cpp
Outdated
Show resolved
Hide resolved
src/Processors/QueryPlan/Optimizations/mergeFilterIntoJoinCondition.cpp
Outdated
Show resolved
Hide resolved
| join_expressions.left_pre_join_actions->mergeNodes(std::move(predicate.left)); | ||
| join_expressions.right_pre_join_actions->mergeNodes(std::move(predicate.right)); |
There was a problem hiding this comment.
mergeNodes is a dangerous function with the limited scope of use, cause it match dag nodes by names. But we don't have a DAG invariant that node names are unique and correct (opposite, DAG can contain any aliases).
Just ::merge should work, but I guess I need to debug why it does not.
Another option is to write a custom function which matches only inputs (it should be simple, actually; it would require replacing rhs dag inputs to matching lhs dag inputs and uniting the list of nodes)
KochetovNicolai
left a comment
There was a problem hiding this comment.
Overall looks good, only additional cast for return type may be needed after filter condition is modified.
Unrelated |
Cherry pick #78877 to 25.4: Merge filter into JOIN condition
Backport #78877 to 25.4: Merge filter into JOIN condition

Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Merge equality conditions from filter query plan step into JOIN condition if possible to allow using them as hash table keys.
Documentation entry for user-facing changes