Skip to content

Commit fcbc039

Browse files
committed
Move NamedValues out of QueryInternal
1 parent b84a932 commit fcbc039

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

ydb/core/fq/libs/control_plane_storage/internal/utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ std::unordered_map<TString, i64> AggregateStatisticsBySources(const NJson::TJson
341341
}
342342
}
343343

344-
void PackStatisticsToProtobuf(google::protobuf::RepeatedPtrField<FederatedQuery::Internal::QueryInternal_NamedValue>& dest, std::string_view statsStr) {
344+
void PackStatisticsToProtobuf(google::protobuf::RepeatedPtrField<FederatedQuery::Internal::StatisticsNamedValue>& dest, std::string_view statsStr) {
345345
NJson::TJsonValue statsJson;
346346
if (!NJson::ReadJsonFastTree(statsStr, &statsJson)) {
347347
return;
@@ -375,7 +375,7 @@ void PackStatisticsToProtobuf(google::protobuf::RepeatedPtrField<FederatedQuery:
375375
}
376376
}
377377

378-
StatsValuesList ExtractStatisticsFromProtobuf(const google::protobuf::RepeatedPtrField<FederatedQuery::Internal::QueryInternal_NamedValue>& statsProto) {
378+
StatsValuesList ExtractStatisticsFromProtobuf(const google::protobuf::RepeatedPtrField<FederatedQuery::Internal::StatisticsNamedValue>& statsProto) {
379379
StatsValuesList statPairs;
380380
statPairs.reserve(statsProto.size());
381381
for (const auto& stat : statsProto) {

ydb/core/fq/libs/control_plane_storage/internal/utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ NYql::TIssues ValidateCreateOrDeleteRateLimiterResource(const TString& queryId,
3535
std::vector<TString> GetMeteringRecords(const TString& statistics, bool billable, const TString& jobId, const TString& scope, const TString& sourceId);
3636
TString GetPrettyStatistics(const TString& statistics);
3737

38-
void PackStatisticsToProtobuf(google::protobuf::RepeatedPtrField<FederatedQuery::Internal::QueryInternal_NamedValue>& dest, std::string_view statsStr);
38+
void PackStatisticsToProtobuf(google::protobuf::RepeatedPtrField<FederatedQuery::Internal::StatisticsNamedValue>& dest, std::string_view statsStr);
3939

4040
using StatsValuesList = std::vector<std::pair<TString, ui64>>;
4141

42-
StatsValuesList ExtractStatisticsFromProtobuf(const google::protobuf::RepeatedPtrField<FederatedQuery::Internal::QueryInternal_NamedValue>& statsProto);
42+
StatsValuesList ExtractStatisticsFromProtobuf(const google::protobuf::RepeatedPtrField<FederatedQuery::Internal::StatisticsNamedValue>& statsProto);
4343

4444
struct Statistics {
4545
operator bool() const noexcept { return !Stats.empty(); }

ydb/core/fq/libs/control_plane_storage/proto/yq_internal.proto

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ message Consumer {
2121
string name = 1;
2222
}
2323

24+
message StatisticsNamedValue {
25+
string name = 1;
26+
int64 value = 2;
27+
}
28+
2429
message QueryInternal {
2530
string token = 1;
2631
repeated NYql.NDqProto.TDqTask task = 2; // deprecated and should not be used, will be removed in future
@@ -50,12 +55,7 @@ message QueryInternal {
5055
NFq.NConfig.TYdbStorageConfig compute_connection = 26;
5156
google.protobuf.Duration result_ttl = 27;
5257
NYql.NDqProto.StatusIds.StatusCode pending_status_code = 28;
53-
54-
message NamedValue {
55-
string name = 1;
56-
int64 value = 2;
57-
}
58-
repeated NamedValue statistics = 29;
58+
repeated StatisticsNamedValue statistics = 29;
5959
}
6060

6161
message JobInternal {

0 commit comments

Comments
 (0)