Skip to content

Commit

Permalink
count size instead of rows
Browse files Browse the repository at this point in the history
  • Loading branch information
lll-phill-lll committed Jan 29, 2025
1 parent 365892b commit 3e3c7c8
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions yql/essentials/minikql/comp_nodes/mkql_wide_combine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ class TState : public TComputationValue<TState> {

bool TasteIt() {
Y_ABORT_UNLESS(!ExtractIt);
++Rows;
bool isNew = false;
auto itInsert = States->Insert(Tongue, isNew);
if (isNew) {
Expand All @@ -288,7 +287,7 @@ class TState : public TComputationValue<TState> {
if (isNew) {
GrowStates();
}
IsOutOfMemory = IsOutOfMemory || (!HasMemoryForProcessing() && Rows > 1000);
IsOutOfMemory = IsOutOfMemory || (!HasMemoryForProcessing() && States->GetSize() > 1000);
return isNew;
}

Expand All @@ -305,10 +304,6 @@ class TState : public TComputationValue<TState> {
}
}

bool CheckIsOutOfMemory() const {
return IsOutOfMemory;
}

template<bool SkipYields>
bool ReadMore() {
if constexpr (SkipYields) {
Expand All @@ -334,7 +329,6 @@ class TState : public TComputationValue<TState> {
Tongue = CurrentPage->data();
StoredDataSize = 0;
IsOutOfMemory = false;
Rows = 0;

CleanupCurrentContext();
return true;
Expand Down Expand Up @@ -369,7 +363,6 @@ class TState : public TComputationValue<TState> {
i64 StoredDataSize = 0;
bool IsOutOfMemory = false;
NYql::NUdf::TCounter CounterOutputRows_;
ui64 Rows = 0;

private:
std::optional<TStorageIterator> ExtractIt;
Expand Down Expand Up @@ -502,7 +495,7 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
ETasteResult TasteIt() {
if (GetMode() == EOperatingMode::InMemory) {
bool isNew = InMemoryProcessingState.TasteIt();
if (InMemoryProcessingState.CheckIsOutOfMemory()) {
if (InMemoryProcessingState.IsOutOfMemory) {
StateWantsToSpill = true;
}
Throat = InMemoryProcessingState.Throat;
Expand Down

0 comments on commit 3e3c7c8

Please sign in to comment.