Skip to content

Commit 2e0e43b

Browse files
authored
Fix and test NULL keys in LEFT / LEFT ONLY in block map join (#9847)
1 parent 32fc06f commit 2e0e43b

File tree

2 files changed

+367
-32
lines changed

2 files changed

+367
-32
lines changed

ydb/library/yql/minikql/comp_nodes/mkql_block_map_join.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,13 @@ using TState = TBlockJoinState<RightRequired>;
257257
while (blockState.IsNotFull() && blockState.NextRow()) {
258258
const auto key = MakeKeysTuple(blockState);
259259
if constexpr (WithoutRight) {
260-
if (key && Dict_.Contains(key) == RightRequired) {
260+
if ((key && Dict_.Contains(key)) == RightRequired) {
261261
blockState.CopyRow();
262262
}
263-
} else if constexpr (RightRequired) {
264-
if (NUdf::TUnboxedValue lookup; key && (lookup = Dict_.Lookup(key))) {
265-
blockState.MakeRow(lookup);
266-
}
267-
} else {
268-
blockState.MakeRow(Dict_.Lookup(key));
263+
} else if (NUdf::TUnboxedValue lookup; key && (lookup = Dict_.Lookup(key))) {
264+
blockState.MakeRow(lookup);
265+
} else if constexpr (!RightRequired) {
266+
blockState.MakeRow(NUdf::TUnboxedValue());
269267
}
270268
}
271269
if (blockState.IsNotFull() && !blockState.IsFinished()) {

0 commit comments

Comments
 (0)