Skip to content

Commit 7ef3027

Browse files
committed
Revert back some changes regarding proto
1 parent 785644e commit 7ef3027

File tree

4 files changed

+33
-32
lines changed

4 files changed

+33
-32
lines changed

ydb/core/kqp/executer_actor/kqp_executer_impl.h

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ class TKqpExecuterBase : public TActorBootstrapped<TDerived> {
402402
for (ui32 txId = 0; txId < Request.Transactions.size(); ++txId) {
403403
const auto& tx = Request.Transactions[txId].Body;
404404
auto planWithStats = AddExecStatsToTxPlan(tx->GetPlan(), execStats);
405-
(*execStats.MutableTxPlansWithStats())[txId] = planWithStats;
405+
execStats.AddTxPlansWithStats(planWithStats);
406406
}
407407
this->Send(Target, progress.Release());
408408
LastProgressStats = now;
@@ -1737,32 +1737,6 @@ class TKqpExecuterBase : public TActorBootstrapped<TDerived> {
17371737
this->Shutdown();
17381738
}
17391739

1740-
void FillResponseStats() {
1741-
auto& response = *ResponseEv->Record.MutableResponse();
1742-
1743-
YQL_ENSURE(Stats);
1744-
1745-
ReportEventElapsedTime();
1746-
1747-
Stats->FinishTs = TInstant::Now();
1748-
Stats->Finish();
1749-
1750-
if (Stats->CollectStatsByLongTasks || CollectFullStats(Request.StatsMode)) {
1751-
for (ui32 txId = 0; txId < Request.Transactions.size(); ++txId) {
1752-
const auto& tx = Request.Transactions[txId].Body;
1753-
auto planWithStats = AddExecStatsToTxPlan(tx->GetPlan(), response.GetResult().GetStats());
1754-
(*response.MutableResult()->MutableStats()->MutableTxPlansWithStats())[txId] = planWithStats;
1755-
}
1756-
}
1757-
1758-
if (Stats->CollectStatsByLongTasks) {
1759-
const auto& txPlansWithStats = response.GetResult().GetStats().GetTxPlansWithStats();
1760-
if (!txPlansWithStats.empty()) {
1761-
LOG_N("Full stats: " << response.GetResult().GetStats());
1762-
}
1763-
}
1764-
}
1765-
17661740
virtual void ReplyErrorAndDie(Ydb::StatusIds::StatusCode status,
17671741
google::protobuf::RepeatedPtrField<Ydb::Issue::IssueMessage>* issues)
17681742
{
@@ -1871,7 +1845,35 @@ class TKqpExecuterBase : public TActorBootstrapped<TDerived> {
18711845

18721846
void PassAway() override {
18731847
YQL_ENSURE(AlreadyReplied && ResponseEv);
1874-
FillResponseStats();
1848+
1849+
// Fill response stats
1850+
{
1851+
auto& response = *ResponseEv->Record.MutableResponse();
1852+
1853+
YQL_ENSURE(Stats);
1854+
1855+
ReportEventElapsedTime();
1856+
1857+
Stats->FinishTs = TInstant::Now();
1858+
Stats->Finish();
1859+
1860+
if (Stats->CollectStatsByLongTasks || CollectFullStats(Request.StatsMode)) {
1861+
response.MutableResult()->MutableStats()->ClearTxPlansWithStats();
1862+
for (ui32 txId = 0; txId < Request.Transactions.size(); ++txId) {
1863+
const auto& tx = Request.Transactions[txId].Body;
1864+
auto planWithStats = AddExecStatsToTxPlan(tx->GetPlan(), response.GetResult().GetStats());
1865+
response.MutableResult()->MutableStats()->AddTxPlansWithStats(planWithStats);
1866+
}
1867+
}
1868+
1869+
if (Stats->CollectStatsByLongTasks) {
1870+
const auto& txPlansWithStats = response.GetResult().GetStats().GetTxPlansWithStats();
1871+
if (!txPlansWithStats.empty()) {
1872+
LOG_N("Full stats: " << response.GetResult().GetStats());
1873+
}
1874+
}
1875+
}
1876+
18751877
Request.Transactions.crop(0);
18761878
this->Send(Target, ResponseEv.release());
18771879

ydb/core/kqp/executer_actor/kqp_literal_executer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class TKqpLiteralExecuter {
264264
for (ui32 txId = 0; txId < Request.Transactions.size(); ++txId) {
265265
const auto& tx = Request.Transactions[txId].Body;
266266
auto planWithStats = AddExecStatsToTxPlan(tx->GetPlan(), response.GetResult().GetStats());
267-
(*response.MutableResult()->MutableStats()->MutableTxPlansWithStats())[txId] = planWithStats;
267+
response.MutableResult()->MutableStats()->AddTxPlansWithStats(planWithStats);
268268
}
269269
}
270270
}

ydb/core/kqp/opt/kqp_query_plan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2817,7 +2817,7 @@ TString AddExecStatsToTxPlan(const TString& txPlanJson, const NYql::NDqProto::TD
28172817
TString SerializeAnalyzePlan(const NKqpProto::TKqpStatsQuery& queryStats, const TString& poolId) {
28182818
TVector<const TString> txPlans;
28192819
for (const auto& execStats: queryStats.GetExecutions()) {
2820-
for (const auto& [txId, txPlan]: execStats.GetTxPlansWithStats()) {
2820+
for (const auto& txPlan: execStats.GetTxPlansWithStats()) {
28212821
txPlans.push_back(txPlan);
28222822
}
28232823
}

ydb/library/yql/dq/actors/protos/dq_stats.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,7 @@ message TDqExecutionStats {
390390
uint64 FirstRowTimeMs = 13; // first result row timestamp, milliseconds
391391

392392
repeated TDqStageStats Stages = 14;
393-
reserved 15; // repeated string TxPlansWithStats = 15;
394-
map<uint32, string> TxPlansWithStats = 16;
393+
repeated string TxPlansWithStats = 15;
395394

396395
google.protobuf.Any Extra = 100;
397396
}

0 commit comments

Comments
 (0)