Skip to content

Commit d0fd3f2

Browse files
lll-phill-lllblinkov
authored andcommitted
Fix early object deletion in wide combiner
Description: <https://nda.ya.ru/t/_8nms0JC7C4StC> commit_hash:6eb7f4b01d1203ca1f66bf7c86cd78f3cd5a2691
1 parent 93d9615 commit d0fd3f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

yql/essentials/minikql/comp_nodes/mkql_wide_combine.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,6 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
504504
// while restoration we process buckets one by one starting from the first in a queue
505505
bool isNew = SpilledBuckets.front().InMemoryProcessingState->TasteIt();
506506
Throat = SpilledBuckets.front().InMemoryProcessingState->Throat;
507-
BufferForUsedInputItems.resize(0);
508507
return isNew ? ETasteResult::Init : ETasteResult::Update;
509508
}
510509

@@ -837,7 +836,7 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
837836
//process spilled data
838837
if (!bucket.SpilledData->Empty()) {
839838
RecoverState = false;
840-
BufferForUsedInputItems.resize(UsedInputItemType->GetElementsCount());
839+
std::fill(BufferForUsedInputItems.begin(), BufferForUsedInputItems.end(), NUdf::TUnboxedValuePod());
841840
AsyncReadOperation = bucket.SpilledData->ExtractWideItem(BufferForUsedInputItems);
842841
if (AsyncReadOperation) {
843842
return EUpdateResult::Yield;
@@ -886,6 +885,9 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
886885
YQL_LOG(INFO) << "switching Memory mode to ProcessSpilled";
887886
MKQL_ENSURE(EOperatingMode::Spilling == Mode, "Internal logic error");
888887
MKQL_ENSURE(SpilledBuckets.size() == SpilledBucketCount, "Internal logic error");
888+
MKQL_ENSURE(BufferForUsedInputItems.empty(), "Internal logic error");
889+
890+
BufferForUsedInputItems.resize(UsedInputItemType->GetElementsCount());
889891

890892
std::sort(SpilledBuckets.begin(), SpilledBuckets.end(), [](const TSpilledBucket& lhs, const TSpilledBucket& rhs) {
891893
bool lhs_in_memory = lhs.BucketState == TSpilledBucket::EBucketState::InMemory;

0 commit comments

Comments
 (0)