diff options
author | tesseract <tesseract@yandex-team.com> | 2024-09-09 14:47:50 +0300 |
---|---|---|
committer | tesseract <tesseract@yandex-team.com> | 2024-09-09 14:59:11 +0300 |
commit | f49f63dc87ade98240dbb20ac1f2889b3b2ef0aa (patch) | |
tree | 550b045b083b7e3dacbf6e29f6d92835ed0c1190 /library | |
parent | a0ea1f59fc02a9855dff1c2e92886dbb297b383a (diff) | |
download | ydb-f49f63dc87ade98240dbb20ac1f2889b3b2ef0aa.tar.gz |
Поддержка автопартиционирования топиков в MVP (перенос из mvp/stable-2024-07)
fix create stream without autopartitioning
Add topics autopartitioning for MVP
fix
add support
apply datastreams patch
Fix empty result of datastreams if kinesisEndpoint is not set
2a51beea2bab550e743f19ec7ee8c5c5eb27ed15
Diffstat (limited to 'library')
-rw-r--r-- | library/cpp/protobuf/json/json2proto.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/library/cpp/protobuf/json/json2proto.cpp b/library/cpp/protobuf/json/json2proto.cpp index f0ca3adf42..823c471b96 100644 --- a/library/cpp/protobuf/json/json2proto.cpp +++ b/library/cpp/protobuf/json/json2proto.cpp @@ -85,7 +85,15 @@ static void JsonString2Duration(const NJson::TJsonValue& json, const google::protobuf::FieldDescriptor& field, const NProtobufJson::TJson2ProtoConfig& config) { using namespace google::protobuf; - if (!json.GetString() && !config.CastRobust) { + if (json.IsMap()) { + const auto& m = json.GetMap(); + Duration duration; + duration.set_seconds(m.contains("Seconds") ? m.at("Seconds").GetInteger() : 0); + duration.set_nanos(m.contains("Nanos") ? m.at("Nanos").GetInteger() : 0); + proto.CopyFrom(duration); + + return; + } else if (!json.GetString() && !config.CastRobust) { ythrow yexception() << "Invalid type of JSON field '" << field.name() << "': " << "IsString() failed while " << "CPPTYPE_STRING is expected."; |