Skip to content

Commit

Permalink
Fix overflow case in stream index lookup join (#11818) (#11822)
Browse files Browse the repository at this point in the history
  • Loading branch information
gridnevvvit authored Nov 25, 2024
1 parent ac5d203 commit d309087
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 @@ -243,7 +243,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 @@ -292,7 +292,7 @@ class TKqpLookupRows : public TKqpStreamLookupWorker {
requests.emplace_back(std::move(request));
PendingKeysByReadId.insert({newReadId, std::move(unprocessedRanges)});
}

return requests;
}

Expand Down Expand Up @@ -507,7 +507,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 @@ -946,6 +946,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 d309087

Please sign in to comment.