Check can become nullable before applying join_use_nulls

This commit is contained in:
vdimir 2023-05-09 16:43:32 +00:00
parent 40d658e467
commit 12141bb6cd
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862

View File

@ -1219,6 +1219,7 @@ private:
static void convertJoinedColumnTypeToNullIfNeeded(QueryTreeNodePtr & resolved_identifier, const JoinKind & join_kind, std::optional<JoinTableSide> resolved_side) static void convertJoinedColumnTypeToNullIfNeeded(QueryTreeNodePtr & resolved_identifier, const JoinKind & join_kind, std::optional<JoinTableSide> resolved_side)
{ {
if (resolved_identifier->getNodeType() == QueryTreeNodeType::COLUMN && if (resolved_identifier->getNodeType() == QueryTreeNodeType::COLUMN &&
JoinCommon::canBecomeNullable(resolved_identifier->getResultType()) &&
(isFull(join_kind) || (isFull(join_kind) ||
(isLeft(join_kind) && resolved_side && *resolved_side == JoinTableSide::Right) || (isLeft(join_kind) && resolved_side && *resolved_side == JoinTableSide::Right) ||
(isRight(join_kind) && resolved_side && *resolved_side == JoinTableSide::Left))) (isRight(join_kind) && resolved_side && *resolved_side == JoinTableSide::Left)))