Skip to content

Commit 4d1257e

Browse files
pashandor789Pavel Ivanov
authored andcommitted
[CBO] Improve Transitive Closure + Cycle processing added (ydb-platform#10121)
1 parent 7a4a18f commit 4d1257e

24 files changed

+929
-583
lines changed

ydb/core/kqp/ut/common/kqp_ut_common.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,24 @@ NJson::TJsonValue GetJoinOrder(const TString& deserializedPlan) {
14631463
return GetJoinOrderImpl(optRoot);
14641464
}
14651465

1466+
NJson::TJsonValue GetJoinOrderFromDetailedJoinOrderImpl(const NJson::TJsonValue& opt) {
1467+
if (!opt.GetMapSafe().contains("table")) {
1468+
NJson::TJsonValue res;
1469+
auto args = opt.GetMapSafe().at("args").GetArraySafe();
1470+
for (size_t i = 0; i < args.size(); ++i) {
1471+
res.AppendValue(GetJoinOrderFromDetailedJoinOrderImpl(args[i]));
1472+
}
1473+
return res;
1474+
}
1475+
1476+
return opt.GetMapSafe().at("table");
1477+
}
1478+
1479+
NJson::TJsonValue GetJoinOrderFromDetailedJoinOrder(const TString& deserializedDetailedJoinOrder) {
1480+
NJson::TJsonValue optRoot;
1481+
NJson::ReadJsonTree(deserializedDetailedJoinOrder, &optRoot, true);
1482+
return GetJoinOrderFromDetailedJoinOrderImpl(optRoot);
1483+
}
14661484

14671485
} // namspace NKqp
14681486
} // namespace NKikimr

ydb/core/kqp/ut/common/kqp_ut_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,5 +350,7 @@ NJson::TJsonValue GetDetailedJoinOrder(const TString& deserializedPlan, const TG
350350
/* Gets tables join order without details : only tables. */
351351
NJson::TJsonValue GetJoinOrder(const TString& deserializedPlan);
352352

353+
NJson::TJsonValue GetJoinOrderFromDetailedJoinOrder(const TString& deserializedDetailedJoinOrder);
354+
353355
} // namespace NKqp
354356
} // namespace NKikimr

ydb/core/kqp/ut/join/data/join_order/lookupbug.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@
6060
}
6161
]
6262
}
63+

ydb/core/kqp/ut/join/data/join_order/tpcc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@
2424
}
2525
]
2626
}
27+

ydb/core/kqp/ut/join/data/join_order/tpcds64_1000s.json

Lines changed: 141 additions & 140 deletions
Large diffs are not rendered by default.

ydb/core/kqp/ut/join/data/join_order/tpcds64_1000s_column_store.json

Lines changed: 141 additions & 140 deletions
Large diffs are not rendered by default.

ydb/core/kqp/ut/join/data/join_order/tpcds64_small_1000s.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@
5252
}
5353
]
5454
}
55+

ydb/core/kqp/ut/join/data/join_order/tpcds64_small_1000s_column_store.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@
5252
}
5353
]
5454
}
55+

ydb/core/kqp/ut/join/data/join_order/tpcds78_1000s.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@
8282
}
8383
]
8484
}
85+

ydb/core/kqp/ut/join/data/join_order/tpcds78_1000s_column_store.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@
8282
}
8383
]
8484
}
85+

0 commit comments

Comments
 (0)