@@ -504,7 +504,6 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
504
504
// while restoration we process buckets one by one starting from the first in a queue
505
505
bool isNew = SpilledBuckets.front ().InMemoryProcessingState ->TasteIt ();
506
506
Throat = SpilledBuckets.front ().InMemoryProcessingState ->Throat ;
507
- BufferForUsedInputItems.resize (0 );
508
507
return isNew ? ETasteResult::Init : ETasteResult::Update;
509
508
}
510
509
@@ -837,7 +836,7 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
837
836
// process spilled data
838
837
if (!bucket.SpilledData ->Empty ()) {
839
838
RecoverState = false ;
840
- BufferForUsedInputItems.resize (UsedInputItemType-> GetElementsCount ());
839
+ std::fill ( BufferForUsedInputItems.begin (), BufferForUsedInputItems. end (), NUdf::TUnboxedValuePod ());
841
840
AsyncReadOperation = bucket.SpilledData ->ExtractWideItem (BufferForUsedInputItems);
842
841
if (AsyncReadOperation) {
843
842
return EUpdateResult::Yield;
@@ -886,6 +885,9 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
886
885
YQL_LOG (INFO) << " switching Memory mode to ProcessSpilled" ;
887
886
MKQL_ENSURE (EOperatingMode::Spilling == Mode, " Internal logic error" );
888
887
MKQL_ENSURE (SpilledBuckets.size () == SpilledBucketCount, " Internal logic error" );
888
+ MKQL_ENSURE (BufferForUsedInputItems.empty (), " Internal logic error" );
889
+
890
+ BufferForUsedInputItems.resize (UsedInputItemType->GetElementsCount ());
889
891
890
892
std::sort (SpilledBuckets.begin (), SpilledBuckets.end (), [](const TSpilledBucket& lhs, const TSpilledBucket& rhs) {
891
893
bool lhs_in_memory = lhs.BucketState == TSpilledBucket::EBucketState::InMemory;
0 commit comments