Skip to content

Commit

Permalink
YQL-18386 reduced number of files created while spilling WideCombiner (
Browse files Browse the repository at this point in the history
  • Loading branch information
lll-phill-lll authored May 21, 2024
1 parent eb9d978 commit 303d901
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,24 +675,27 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {

void SwitchMode(EOperatingMode mode, TComputationContext& ctx) {
switch(mode) {
case EOperatingMode::InMemory:
case EOperatingMode::InMemory: {
MKQL_ENSURE(false, "Internal logic error");
break;
case EOperatingMode::Spilling:
}
case EOperatingMode::Spilling: {
MKQL_ENSURE(EOperatingMode::InMemory == Mode, "Internal logic error");
SpilledBuckets.resize(SpilledBucketCount);
auto spiller = ctx.SpillerFactory->CreateSpiller();
for (auto &b: SpilledBuckets) {
auto spiller = ctx.SpillerFactory->CreateSpiller();
b.SpilledState = std::make_unique<TWideUnboxedValuesSpillerAdapter>(spiller, KeyAndStateType, 5_MB);
b.SpilledData = std::make_unique<TWideUnboxedValuesSpillerAdapter>(spiller, UsedInputItemType, 5_MB);
b.InMemoryProcessingState = std::make_unique<TState>(MemInfo, KeyWidth, KeyAndStateType->GetElementsCount() - KeyWidth, Hasher, Equal);
}
SplitStateIntoBuckets();
break;
case EOperatingMode::ProcessSpilled:
}
case EOperatingMode::ProcessSpilled: {
MKQL_ENSURE(EOperatingMode::Spilling == Mode, "Internal logic error");
MKQL_ENSURE(SpilledBuckets.size() == SpilledBucketCount, "Internal logic error");
break;
}

}
Mode = mode;
Expand Down

0 comments on commit 303d901

Please sign in to comment.