Skip to content

Commit

Permalink
Fix overflow case in stream index lookup join (ydb-platform#11818)
Browse files Browse the repository at this point in the history
  • Loading branch information
gridnevvvit authored Nov 20, 2024
1 parent 779684a commit 41baadd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ydb/core/kqp/runtime/kqp_stream_lookup_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class TKqpLookupRows : public TKqpStreamLookupWorker {
}
}

std::vector<THolder<TEvDataShard::TEvRead>> RebuildRequest(const ui64& prevReadId, ui32 firstUnprocessedQuery,
std::vector<THolder<TEvDataShard::TEvRead>> RebuildRequest(const ui64& prevReadId, ui32 firstUnprocessedQuery,
TMaybe<TOwnedCellVec> lastProcessedKey, ui64& newReadId) final {

auto it = PendingKeysByReadId.find(prevReadId);
Expand Down Expand Up @@ -280,7 +280,7 @@ class TKqpLookupRows : public TKqpStreamLookupWorker {
requests.emplace_back(std::move(request));
PendingKeysByReadId.insert({newReadId, std::move(unprocessedRanges)});
}

return requests;
}

Expand Down Expand Up @@ -495,7 +495,7 @@ class TKqpJoinRows : public TKqpStreamLookupWorker {
UnprocessedRows.emplace_back(std::make_pair(TOwnedCellVec(joinKeyCells), std::move(inputRow.GetElement(1))));
}

std::vector<THolder<TEvDataShard::TEvRead>> RebuildRequest(const ui64& prevReadId, ui32 firstUnprocessedQuery,
std::vector<THolder<TEvDataShard::TEvRead>> RebuildRequest(const ui64& prevReadId, ui32 firstUnprocessedQuery,
TMaybe<TOwnedCellVec> lastProcessedKey, ui64& newReadId) final {

auto readIt = PendingKeysByReadId.find(prevReadId);
Expand Down Expand Up @@ -934,6 +934,7 @@ class TKqpJoinRows : public TKqpStreamLookupWorker {
if (rowStats.ResultBytesCount > (ui64)freeSpace) {
resultRow.DeleteUnreferenced();
rowStats.Clear();
return NUdf::TUnboxedValuePod();
}

return resultRow;
Expand Down

0 comments on commit 41baadd

Please sign in to comment.