diff --git a/yql/essentials/minikql/comp_nodes/mkql_wide_combine.cpp b/yql/essentials/minikql/comp_nodes/mkql_wide_combine.cpp index b1e6286b6a66..d4f9d80f22cc 100644 --- a/yql/essentials/minikql/comp_nodes/mkql_wide_combine.cpp +++ b/yql/essentials/minikql/comp_nodes/mkql_wide_combine.cpp @@ -273,7 +273,6 @@ class TState : public TComputationValue { bool TasteIt() { Y_ABORT_UNLESS(!ExtractIt); - ++Rows; bool isNew = false; auto itInsert = States->Insert(Tongue, isNew); if (isNew) { @@ -288,7 +287,7 @@ class TState : public TComputationValue { if (isNew) { GrowStates(); } - IsOutOfMemory = IsOutOfMemory || (!HasMemoryForProcessing() && Rows > 1000); + IsOutOfMemory = IsOutOfMemory || (!HasMemoryForProcessing() && States->GetSize() > 1000); return isNew; } @@ -305,10 +304,6 @@ class TState : public TComputationValue { } } - bool CheckIsOutOfMemory() const { - return IsOutOfMemory; - } - template bool ReadMore() { if constexpr (SkipYields) { @@ -334,7 +329,6 @@ class TState : public TComputationValue { Tongue = CurrentPage->data(); StoredDataSize = 0; IsOutOfMemory = false; - Rows = 0; CleanupCurrentContext(); return true; @@ -369,7 +363,6 @@ class TState : public TComputationValue { i64 StoredDataSize = 0; bool IsOutOfMemory = false; NYql::NUdf::TCounter CounterOutputRows_; - ui64 Rows = 0; private: std::optional ExtractIt; @@ -502,7 +495,7 @@ class TSpillingSupportState : public TComputationValue { ETasteResult TasteIt() { if (GetMode() == EOperatingMode::InMemory) { bool isNew = InMemoryProcessingState.TasteIt(); - if (InMemoryProcessingState.CheckIsOutOfMemory()) { + if (InMemoryProcessingState.IsOutOfMemory) { StateWantsToSpill = true; } Throat = InMemoryProcessingState.Throat;