diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp index 637c95a76831..01ff497a8d40 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp @@ -274,7 +274,14 @@ class TState : public TComputationValue { Tongue = CurrentPage->data() + CurrentPosition; } Throat = States.GetKey(itInsert) + KeyWidth; - if (isNew && !IsOutOfMemory) { + if (isNew) { + SafeGrow(); + } + return isNew; + } + + void SafeGrow() { + if (!IsOutOfMemory) { try { States.CheckGrow(); } catch (const TMemoryLimitExceededException& e) { @@ -282,7 +289,6 @@ class TState : public TComputationValue { IsOutOfMemory = true; } } - return isNew; } bool CheckIsOutOfMemory() const { @@ -848,7 +854,6 @@ class TSpillingSupportState : public TComputationValue { } bool IsSwitchToSpillingModeCondition() const { - return false; return !HasMemoryForProcessing() || TlsAllocState->GetMaximumLimitValueReached(); }