Skip to content

Commit 1e0b2d6

Browse files
authored
streamlookup: fix for left table name is prefix of right table (#9177)
1 parent b0a5850 commit 1e0b2d6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,15 +352,17 @@ TOutputRowColumnOrder CategorizeOutputRowItems(
352352
size_t idxRightPayload = 0;
353353
for (ui32 i = 0; i != type->GetMembersCount(); ++i) {
354354
const auto prefixedName = type->GetMemberName(i);
355-
if (prefixedName.starts_with(leftLabel)) {
356-
Y_ABORT_IF(prefixedName.length() == leftLabel.length());
355+
if (prefixedName.starts_with(leftLabel) &&
356+
prefixedName.length() > leftLabel.length() &&
357+
prefixedName[leftLabel.length()] == '.') {
357358
const auto name = prefixedName.SubStr(leftLabel.length() + 1); //skip prefix and dot
358359
result[i] = {
359360
leftJoinColumns.contains(name) ? EOutputRowItemSource::InputKey : EOutputRowItemSource::InputOther,
360361
idxLeft++
361362
};
362-
} else if (prefixedName.starts_with(rightLabel)) {
363-
Y_ABORT_IF(prefixedName.length() == rightLabel.length());
363+
} else if (prefixedName.starts_with(rightLabel) &&
364+
prefixedName.length() > rightLabel.length() &&
365+
prefixedName[rightLabel.length()] == '.') {
364366
const auto name = prefixedName.SubStr(rightLabel.length() + 1); //skip prefix and dot
365367
//presume that indexes in LookupKey, LookupOther has the same relative position as in OutputRow
366368
if (rightJoinColumns.contains(name)) {

0 commit comments

Comments
 (0)