Skip to content

Commit bde88f9

Browse files
committed
first test works
1 parent 896b505 commit bde88f9

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,10 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
554554
std::cerr << std::format("MISHA: {} {} {}\n", AllowSpilling, (bool)Ctx.SpillerFactory, IsSwitchToSpillingModeCondition());
555555
if (AllowSpilling && Ctx.SpillerFactory && IsSwitchToSpillingModeCondition()) {
556556
std::cerr << "MISHA spilling enabled" << std::endl;
557-
const auto used = TlsAllocState->GetUsed();
558-
const auto limit = TlsAllocState->GetLimit();
557+
// const auto used = TlsAllocState->GetUsed();
558+
// const auto limit = TlsAllocState->GetLimit();
559559

560-
YQL_LOG(INFO) << "yellow zone reached " << (used*100/limit) << "%=" << used << "/" << limit;
560+
// YQL_LOG(INFO) << "yellow zone reached " << (used*100/limit) << "%=" << used << "/" << limit;
561561
YQL_LOG(INFO) << "switching Memory mode to Spilling";
562562

563563
SwitchMode(EOperatingMode::Spilling);

ydb/library/yql/minikql/comp_nodes/ut/mkql_wide_combine_ut.cpp

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,16 +1066,26 @@ Y_UNIT_TEST_SUITE(TMiniKQLWideLastCombinerTest) {
10661066
));
10671067

10681068
const auto graph = setup.BuildGraph(pgmReturn);
1069+
graph->GetContext().SpillerFactory = std::make_shared<TMockSpillerFactory>();
10691070
const auto iterator = graph->GetValue().GetListIterator();
1071+
1072+
std::unordered_set<TString> expected {
1073+
"key one",
1074+
"very long value 2 / key two",
1075+
"very long key one",
1076+
"very long value 8 / very long value 7 / very long value 6"
1077+
};
1078+
10701079
NUdf::TUnboxedValue item;
1071-
UNIT_ASSERT(iterator.Next(item));
1072-
UNBOXED_VALUE_STR_EQUAL(item, "key one");
1073-
UNIT_ASSERT(iterator.Next(item));
1074-
UNBOXED_VALUE_STR_EQUAL(item, "very long value 2 / key two");
1075-
UNIT_ASSERT(iterator.Next(item));
1076-
UNBOXED_VALUE_STR_EQUAL(item, "very long key one");
1077-
UNIT_ASSERT(iterator.Next(item));
1078-
UNBOXED_VALUE_STR_EQUAL(item, "very long value 8 / very long value 7 / very long value 6");
1080+
while (!expected.empty()) {
1081+
UNIT_ASSERT(iterator.Next(item));
1082+
// const auto actual = item.AsStringRef();
1083+
TString actual = item.AsStringRef().Data();
1084+
1085+
auto it = expected.find(actual);
1086+
UNIT_ASSERT(it != expected.end());
1087+
expected.erase(it);
1088+
}
10791089
UNIT_ASSERT(!iterator.Next(item));
10801090
UNIT_ASSERT(!iterator.Next(item));
10811091
}

0 commit comments

Comments
 (0)