@@ -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