@@ -1284,8 +1284,12 @@ Y_UNIT_TEST_SUITE(TMiniKQLWideLastCombinerTest) {
1284
1284
UNIT_ASSERT (!iterator.Next (item));
1285
1285
}
1286
1286
1287
- Y_UNIT_TEST_LLVM (TestDoNotCalculateUnusedOutput) {
1288
- TSetup<LLVM> setup;
1287
+ Y_UNIT_TEST_LLVM_SPILLING (TestDoNotCalculateUnusedOutput) {
1288
+ // Currently LLVM version doesn't support spilling.
1289
+ if (LLVM && SPILLING) return ;
1290
+ // callable WideLastCombinerWithSpilling was introduced in 49 version of runtime
1291
+ if (MKQL_RUNTIME_VERSION < 49U && SPILLING) return ;
1292
+ TSetup<LLVM, SPILLING> setup;
1289
1293
TProgramBuilder& pb = *setup.PgmBuilder ;
1290
1294
1291
1295
const auto dataType = pb.NewDataType (NUdf::TDataType<const char *>::Id);
@@ -1319,7 +1323,11 @@ Y_UNIT_TEST_SUITE(TMiniKQLWideLastCombinerTest) {
1319
1323
1320
1324
const auto landmine = pb.NewDataLiteral <NUdf::EDataSlot::String>(" ACHTUNG MINEN!" );
1321
1325
1322
- const auto pgmReturn = pb.Collect (pb.NarrowMap (pb.WideLastCombiner (pb.ExpandMap (pb.ToFlow (list),
1326
+ auto wideLastCombinerCollable = &TProgramBuilder::WideLastCombiner;
1327
+ if (SPILLING) {
1328
+ wideLastCombinerCollable = &TProgramBuilder::WideLastCombinerWithSpilling;
1329
+ }
1330
+ const auto pgmReturn = pb.Collect (pb.NarrowMap ((pb.*wideLastCombinerCollable)(pb.ExpandMap (pb.ToFlow (list),
1323
1331
[&](TRuntimeNode item) -> TRuntimeNode::TList { return {pb.Nth (item, 0U ), pb.Nth (item, 1U ), pb.Nth (item, 2U )}; }),
1324
1332
[&](TRuntimeNode::TList items) -> TRuntimeNode::TList { return {items.front ()}; },
1325
1333
[&](TRuntimeNode::TList, TRuntimeNode::TList items) -> TRuntimeNode::TList {
@@ -1335,26 +1343,46 @@ Y_UNIT_TEST_SUITE(TMiniKQLWideLastCombinerTest) {
1335
1343
));
1336
1344
1337
1345
const auto graph = setup.BuildGraph (pgmReturn);
1346
+ if (SPILLING) {
1347
+ graph->GetContext ().SpillerFactory = std::make_shared<TMockSpillerFactory>();
1348
+ }
1349
+ std::unordered_set<TString> expected {
1350
+ " key one: value 1, value 4, value 5, value 1, value 2" ,
1351
+ " key two: value 2, value 3, value 3, value 4"
1352
+ };
1353
+
1338
1354
const auto iterator = graph->GetValue ().GetListIterator ();
1339
1355
NUdf::TUnboxedValue item;
1340
- UNIT_ASSERT (iterator.Next (item));
1341
- UNBOXED_VALUE_STR_EQUAL (item, " key one: value 1, value 4, value 5, value 1, value 2" );
1342
- UNIT_ASSERT (iterator.Next (item));
1343
- UNBOXED_VALUE_STR_EQUAL (item, " key two: value 2, value 3, value 3, value 4" );
1356
+ while (!expected.empty ()) {
1357
+ UNIT_ASSERT (iterator.Next (item));
1358
+ TString actual = item.AsStringRef ().Data ();
1359
+
1360
+ auto it = expected.find (actual);
1361
+ UNIT_ASSERT (it != expected.end ());
1362
+ expected.erase (it);
1363
+ }
1344
1364
UNIT_ASSERT (!iterator.Next (item));
1345
1365
UNIT_ASSERT (!iterator.Next (item));
1346
1366
}
1347
1367
1348
- Y_UNIT_TEST_LLVM (TestThinAllLambdas) {
1349
- TSetup<LLVM> setup;
1368
+ Y_UNIT_TEST_LLVM_SPILLING (TestThinAllLambdas) {
1369
+ // Currently LLVM version doesn't support spilling.
1370
+ if (LLVM && SPILLING) return ;
1371
+ // callable WideLastCombinerWithSpilling was introduced in 49 version of runtime
1372
+ if (MKQL_RUNTIME_VERSION < 49U && SPILLING) return ;
1373
+ TSetup<LLVM, SPILLING> setup;
1350
1374
TProgramBuilder& pb = *setup.PgmBuilder ;
1351
1375
1352
1376
const auto tupleType = pb.NewTupleType ({});
1353
1377
const auto data = pb.NewTuple ({});
1354
1378
1355
1379
const auto list = pb.NewList (tupleType, {data, data, data, data});
1356
1380
1357
- const auto pgmReturn = pb.Collect (pb.NarrowMap (pb.WideLastCombiner (pb.ExpandMap (pb.ToFlow (list),
1381
+ auto wideLastCombinerCollable = &TProgramBuilder::WideLastCombiner;
1382
+ if (SPILLING) {
1383
+ wideLastCombinerCollable = &TProgramBuilder::WideLastCombinerWithSpilling;
1384
+ }
1385
+ const auto pgmReturn = pb.Collect (pb.NarrowMap ((pb.*wideLastCombinerCollable)(pb.ExpandMap (pb.ToFlow (list),
1358
1386
[](TRuntimeNode) -> TRuntimeNode::TList { return {}; }),
1359
1387
[](TRuntimeNode::TList items) { return items; },
1360
1388
[](TRuntimeNode::TList, TRuntimeNode::TList items) { return items; },
0 commit comments