Skip to content

Commit 5c04260

Browse files
committed
[KQP] Plan fix
1 parent e555b24 commit 5c04260

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

ydb/core/kqp/ut/join/kqp_join_order_ut.cpp

+27-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void PrintPlan(const TString& plan) {
100100
class TChainTester {
101101
public:
102102
TChainTester(size_t chainSize)
103-
: Kikimr(GetKikimrWithJoinSettings())
103+
: Kikimr(GetKikimrWithJoinSettings(false, GetStats(chainSize)))
104104
, TableClient(Kikimr.GetTableClient())
105105
, Session(TableClient.CreateSession().GetValueSync().GetSession())
106106
, ChainSize(chainSize)
@@ -112,6 +112,21 @@ class TChainTester {
112112
JoinTables();
113113
}
114114

115+
static TString GetStats(size_t chainSize) {
116+
srand(228);
117+
NJson::TJsonValue stats;
118+
for (size_t i = 0; i < chainSize; ++i) {
119+
ui64 nRows = rand();
120+
NJson::TJsonValue tableStat;
121+
tableStat["n_rows"] = nRows;
122+
tableStat["byte_size"] = nRows * 10;
123+
124+
TString table = Sprintf("/Root/table_%ld", i);
125+
stats[table] = std::move(tableStat);
126+
}
127+
return stats.GetStringRobust();
128+
}
129+
115130
private:
116131
void CreateTables() {
117132
for (size_t i = 0; i < ChainSize; ++i) {
@@ -133,6 +148,17 @@ class TChainTester {
133148

134149
joinRequest.append("SELECT * FROM `/Root/table_0` as t0 ");
135150

151+
srand(228);
152+
NJson::TJsonValue stats;
153+
for (size_t i = 0; i < ChainSize; ++i) {
154+
TString table = Sprintf("/Root/table_%ld", i);
155+
int nRows = rand();
156+
NJson::TJsonValue tableStat;
157+
tableStat[table]["n_rows"] = nRows;
158+
tableStat[table]["byte_size"] = nRows * 10;
159+
stats.AppendValue(std::move(tableStat));
160+
}
161+
136162
for (size_t i = 1; i < ChainSize; ++i) {
137163
TString table = Sprintf("/Root/table_%ld", i);
138164

0 commit comments

Comments
 (0)