diff options
author | ermolovd <ermolovd@yandex-team.com> | 2024-11-26 15:38:34 +0300 |
---|---|---|
committer | ermolovd <ermolovd@yandex-team.com> | 2024-11-26 15:52:27 +0300 |
commit | 0f8ebb5baf44e7aad96d0694c3148889b9a9d2b6 (patch) | |
tree | 591cefe9a40ded248b5efd92480ec8dcb33117b9 /yt/cpp/mapreduce/interface | |
parent | 2ab257cebc2f896cfe01f8bfb27ad34c644f93fe (diff) | |
download | ydb-0f8ebb5baf44e7aad96d0694c3148889b9a9d2b6.tar.gz |
YT-23568: `create` attribute in RichYPath
* Changelog entry
Type: feature
Component: cpp-sdk
Add support for `create` attribute in RichYPath.
Don't create paths explicitly if `create` attribute is specified.
commit_hash:52e77ce4cf5e21fae6d6e510ffb0edba35ec2a1d
Diffstat (limited to 'yt/cpp/mapreduce/interface')
-rw-r--r-- | yt/cpp/mapreduce/interface/common.h | 8 | ||||
-rw-r--r-- | yt/cpp/mapreduce/interface/serialize.cpp | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/yt/cpp/mapreduce/interface/common.h b/yt/cpp/mapreduce/interface/common.h index 76df343e68..aff09c173f 100644 --- a/yt/cpp/mapreduce/interface/common.h +++ b/yt/cpp/mapreduce/interface/common.h @@ -1124,6 +1124,14 @@ struct TRichYPath /// Allows to start cross-transactional operations. FLUENT_FIELD_OPTION(TTransactionId, TransactionId); + /// + /// @brief Wether to create operation output path. + /// + /// If set to `true` output path is created by YT server. + /// If set to `false` output path is not created explicitly (and operation will fail if it doesn't exist) + /// If attribute is not set output path is created by this library using explicit master call. + FLUENT_FIELD_OPTION(bool, Create); + using TRenameColumnsDescriptor = THashMap<TString, TString>; /// Specifies columnar mapping which will be applied to columns before transfer to job. diff --git a/yt/cpp/mapreduce/interface/serialize.cpp b/yt/cpp/mapreduce/interface/serialize.cpp index 519439d879..5ea65b62f1 100644 --- a/yt/cpp/mapreduce/interface/serialize.cpp +++ b/yt/cpp/mapreduce/interface/serialize.cpp @@ -471,6 +471,9 @@ void Serialize(const TRichYPath& path, NYson::IYsonConsumer* consumer) .DoIf(path.Cluster_.Defined(), [&] (TFluentAttributes fluent) { fluent.Item("cluster").Value(*path.Cluster_); }) + .DoIf(path.Create_.Defined(), [&] (TFluentAttributes fluent) { + fluent.Item("create").Value(*path.Create_); + }) .EndAttributes() .Value(path.Path_); } @@ -503,6 +506,7 @@ void Deserialize(TRichYPath& path, const TNode& node) DESERIALIZE_ATTR("rename_columns", path.RenameColumns_); DESERIALIZE_ATTR("bypass_artifact_cache", path.BypassArtifactCache_); DESERIALIZE_ATTR("cluster", path.Cluster_); + DESERIALIZE_ATTR("create", path.Create_); Deserialize(path.Path_, node); } |