File tree Expand file tree Collapse file tree 6 files changed +20
-3
lines changed
include/ydb-cpp-sdk/client Expand file tree Collapse file tree 6 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class TExecStats {
29
29
30
30
std::optional<std::string> GetPlan () const ;
31
31
std::optional<std::string> GetAst () const ;
32
+ std::optional<std::string> GetMeta () const ;
32
33
33
34
TDuration GetTotalDuration () const ;
34
35
TDuration GetTotalCpuTime () const ;
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ namespace NTable {
30
30
enum class ECollectQueryStatsMode {
31
31
None = 0 , // Stats collection is disabled
32
32
Basic = 1 , // Aggregated stats of reads, updates and deletes per table
33
- Full = 2 , // Add per-stage execution profile and query plan on top of Basic mode
33
+ Full = 2 , // Add per-stage execution profile, query plan and query meta on top of Basic mode
34
34
Profile = 3 // Detailed execution stats including stats for individual tasks and channels
35
35
};
36
36
Original file line number Diff line number Diff line change @@ -1164,6 +1164,7 @@ struct TStreamExecScanQuerySettings : public TRequestSettings<TStreamExecScanQue
1164
1164
// Collect runtime statistics with a given detalization mode
1165
1165
FLUENT_SETTING_DEFAULT (ECollectQueryStatsMode, CollectQueryStats, ECollectQueryStatsMode::None);
1166
1166
1167
+ // Deprecated. Use CollectQueryStats >= ECollectQueryStatsMode::Full to get QueryMeta in QueryStats
1167
1168
// Collect full query compilation diagnostics
1168
1169
FLUENT_SETTING_DEFAULT (bool , CollectFullDiagnostics, false );
1169
1170
};
@@ -2109,6 +2110,7 @@ class TScanQueryPart : public TStreamPartStatus {
2109
2110
const TQueryStats& GetQueryStats () const { return *QueryStats_; }
2110
2111
TQueryStats ExtractQueryStats () { return std::move (*QueryStats_); }
2111
2112
2113
+ // Deprecated. Use GetMeta() of TQueryStats
2112
2114
bool HasDiagnostics () const { return Diagnostics_.has_value (); }
2113
2115
const std::string& GetDiagnostics () const { return *Diagnostics_; }
2114
2116
std::string&& ExtractDiagnostics() { return std::move (*Diagnostics_); }
Original file line number Diff line number Diff line change @@ -43,4 +43,7 @@ message QueryStats {
43
43
string query_ast = 5 ;
44
44
uint64 total_duration_us = 6 ;
45
45
uint64 total_cpu_time_us = 7 ;
46
+ // will be filled only in MODE_EXPLAIN or in MODE_EXEC with QueryStatsCollection.Mode >= STATS_COLLECTION_FULL,
47
+ // collects additional meta about query compilation, including table metadata
48
+ string query_meta = 8 ;
46
49
}
Original file line number Diff line number Diff line change @@ -1274,7 +1274,7 @@ message ExecuteScanQueryRequest {
1274
1274
QueryStatsCollection.Mode collect_stats = 8 ;
1275
1275
// works only in mode: MODE_EXPLAIN,
1276
1276
// collects additional diagnostics about query compilation, including query plan and scheme
1277
- bool collect_full_diagnostics = 9 ;
1277
+ bool collect_full_diagnostics = 9 [ deprecated = true ] ;
1278
1278
}
1279
1279
1280
1280
message ExecuteScanQueryPartialResponse {
@@ -1292,7 +1292,7 @@ message ExecuteScanQueryPartialResult {
1292
1292
Ydb.TableStats.QueryStats query_stats = 6 ;
1293
1293
// works only in mode: MODE_EXPLAIN,
1294
1294
// collects additional diagnostics about query compilation, including query plan and scheme
1295
- string query_full_diagnostics = 7 ;
1295
+ string query_full_diagnostics = 7 [ deprecated = true ] ;
1296
1296
}
1297
1297
1298
1298
// Returns information about an external data source with a given path.
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ std::string TExecStats::ToString(bool withPlan) const {
31
31
if (!withPlan) {
32
32
proto.clear_query_plan ();
33
33
proto.clear_query_ast ();
34
+ proto.clear_query_meta ();
34
35
}
35
36
36
37
TStringType res;
@@ -58,6 +59,16 @@ std::optional<std::string> TExecStats::GetAst() const {
58
59
return proto.query_ast ();
59
60
}
60
61
62
+ std::optional<std::string> TExecStats::GetMeta () const {
63
+ auto proto = Impl_->Proto ;
64
+
65
+ if (proto.query_meta ().empty ()) {
66
+ return {};
67
+ }
68
+
69
+ return proto.query_meta ();
70
+ }
71
+
61
72
TDuration TExecStats::GetTotalDuration () const {
62
73
return TDuration::MicroSeconds (Impl_->Proto .total_duration_us ());
63
74
}
You can’t perform that action at this time.
0 commit comments