Fix another case.,

This commit is contained in:
Nikolai Kochetov 2023-12-14 14:51:38 +00:00
parent 676b913a92
commit 80e9d7c45f

View File

@ -301,12 +301,14 @@ void buildJoinClause(
}
else if (left_expression_side_optional && !right_expression_side_optional)
{
const auto * node = appendExpression(left_dag, join_expression, planner_context, join_node);
auto & dag = *left_expression_side_optional == JoinTableSide::Left ? left_dag : right_dag;
const auto * node = appendExpression(dag, join_expression, planner_context, join_node);
join_clause.addCondition(*left_expression_side_optional, node);
}
else if (!left_expression_side_optional && right_expression_side_optional)
{
const auto * node = appendExpression(right_dag, join_expression, planner_context, join_node);
auto & dag = *right_expression_side_optional == JoinTableSide::Left ? left_dag : right_dag;
const auto * node = appendExpression(dag, join_expression, planner_context, join_node);
join_clause.addCondition(*right_expression_side_optional, node);
}
else
@ -619,6 +621,11 @@ JoinClausesAndActions buildJoinClausesAndActions(//const ColumnsWithTypeAndName
result.left_join_tmp_expression_actions = std::move(left_join_actions);
result.left_join_expressions_actions->removeUnusedActions(join_left_actions_names);
// for (const auto & name : join_right_actions_names)
// std::cerr << ".. " << name << std::endl;
// std::cerr << right_join_actions->dumpDAG() << std::endl;
result.right_join_expressions_actions = right_join_actions->clone();
result.right_join_tmp_expression_actions = std::move(right_join_actions);
result.right_join_expressions_actions->removeUnusedActions(join_right_actions_names);