Skip to content

Commit 650640a

Browse files
authored
Merge e289759 into 30ebe53
2 parents 30ebe53 + e289759 commit 650640a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

ydb/library/yql/dq/actors/input_transforms/dq_input_transform_lookup.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,17 @@ class TInputTransformStreamLookupBase
214214
NUdf::TUnboxedValue key = HolderFactory.CreateDirectArrayHolder(LookupInputIndexes.size(), keyItems);
215215
NUdf::TUnboxedValue* otherItems;
216216
NUdf::TUnboxedValue other = HolderFactory.CreateDirectArrayHolder(OtherInputIndexes.size(), otherItems);
217+
bool nullsInKey = false;
217218
for (size_t i = 0; i != LookupInputIndexes.size(); ++i) {
218219
keyItems[i] = inputRowItems[LookupInputIndexes[i]];
220+
nullsInKey |= !keyItems[i];
219221
}
220222
for (size_t i = 0; i != OtherInputIndexes.size(); ++i) {
221223
otherItems[i] = inputRowItems[OtherInputIndexes[i]];
222224
}
223-
if (auto lookupPayload = LruCache->Get(key, now)) {
225+
if (nullsInKey) {
226+
AddReadyQueue(key, other, nullptr);
227+
} else if (auto lookupPayload = LruCache->Get(key, now)) {
224228
AddReadyQueue(key, other, &*lookupPayload);
225229
} else {
226230
AwaitingQueue.emplace_back(key, std::move(other));

ydb/tests/fq/generic/streaming/test_join.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def freeze(json):
131131
('{"id":9,"user":3}', '{"id":9,"user_id":3,"lookup":"ydb30"}'),
132132
('{"id":2,"user":2}', '{"id":2,"user_id":2,"lookup":"ydb20"}'),
133133
('{"id":1,"user":1}', '{"id":1,"user_id":1,"lookup":"ydb10"}'),
134+
('{"id":10,"user":null}', '{"id":10,"user_id":null,"lookup":null}'),
134135
('{"id":4,"user":3}', '{"id":4,"user_id":3,"lookup":"ydb30"}'),
135136
('{"id":5,"user":3}', '{"id":5,"user_id":3,"lookup":"ydb30"}'),
136137
('{"id":6,"user":1}', '{"id":6,"user_id":1,"lookup":"ydb10"}'),
@@ -350,6 +351,10 @@ def freeze(json):
350351
'{"id":3,"za":2,"yb":"1","yc":114,"zd":115}',
351352
'{"a":null,"b":null,"c":null,"d":null,"e":null,"f":null,"za":2,"yb":"1","yc":114,"zd":115}',
352353
),
354+
(
355+
'{"id":3,"za":2,"yb":null,"yc":114,"zd":115}',
356+
'{"a":null,"b":null,"c":null,"d":null,"e":null,"f":null,"za":2,"yb":null,"yc":114,"zd":115}',
357+
),
353358
]
354359
),
355360
),
@@ -391,6 +396,10 @@ def freeze(json):
391396
'{"id":3,"za":2,"yb":"1","yc":114,"zd":115}',
392397
'{"a":null,"b":null,"c":null,"d":null,"e":null,"f":null,"za":2,"yb":"1","yc":114,"zd":115}',
393398
),
399+
(
400+
'{"id":3,"za":null,"yb":"1","yc":114,"zd":115}',
401+
'{"a":null,"b":null,"c":null,"d":null,"e":null,"f":null,"za":null,"yb":"1","yc":114,"zd":115}',
402+
),
394403
]
395404
),
396405
),

0 commit comments

Comments
 (0)