diff options
author | Vadim Averin <avevad@ydb.tech> | 2024-01-10 19:29:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-10 19:29:58 +0300 |
commit | 4944f90a4afb6439b879c12e5962f65bb1664e36 (patch) | |
tree | 59d88a785362d349da97d456ed7fdb52621ecb01 | |
parent | 4a6a800c3ded875fab7e314314ffc16f67acd548 (diff) | |
download | ydb-4944f90a4afb6439b879c12e5962f65bb1664e36.tar.gz |
Add YT pragmas for `description` and `started_by` (#918)
3 files changed, 24 insertions, 0 deletions
diff --git a/ydb/library/yql/providers/yt/common/yql_yt_settings.cpp b/ydb/library/yql/providers/yt/common/yql_yt_settings.cpp index 508aae116b..b9538e8417 100644 --- a/ydb/library/yql/providers/yt/common/yql_yt_settings.cpp +++ b/ydb/library/yql/providers/yt/common/yql_yt_settings.cpp @@ -363,6 +363,20 @@ TYtConfiguration::TYtConfiguration() throw yexception() << "Expected yson map, but got " << value.GetType(); } }); + REGISTER_SETTING(*this, Description) + .Parser([](const TString& v) { return NYT::NodeFromYsonString(v); }) + .Validator([] (const TString&, const NYT::TNode& value) { + if (!value.IsMap()) { + throw yexception() << "Expected yson map, but got " << value.GetType(); + } + }); + REGISTER_SETTING(*this, StartedBy) + .Parser([](const TString& v) { return NYT::NodeFromYsonString(v); }) + .Validator([] (const TString&, const NYT::TNode& value) { + if (!value.IsMap()) { + throw yexception() << "Expected yson map, but got " << value.GetType(); + } + }); REGISTER_SETTING(*this, MaxSpeculativeJobCountPerTask); REGISTER_SETTING(*this, LLVMMemSize); REGISTER_SETTING(*this, LLVMPerNodeMemSize); diff --git a/ydb/library/yql/providers/yt/common/yql_yt_settings.h b/ydb/library/yql/providers/yt/common/yql_yt_settings.h index 9b5de8aa7c..469a6c1166 100644 --- a/ydb/library/yql/providers/yt/common/yql_yt_settings.h +++ b/ydb/library/yql/providers/yt/common/yql_yt_settings.h @@ -162,6 +162,8 @@ struct TYtSettings { NCommon::TConfSetting<NYT::TNode, true> JobEnv; NCommon::TConfSetting<NYT::TNode, true> OperationSpec; NCommon::TConfSetting<NYT::TNode, true> Annotations; + NCommon::TConfSetting<NYT::TNode, true> StartedBy; + NCommon::TConfSetting<NYT::TNode, true> Description; NCommon::TConfSetting<bool, true> UseSkiff; NCommon::TConfSetting<ui32, true> TableContentCompressLevel; NCommon::TConfSetting<bool, true> DisableJobSplitting; diff --git a/ydb/library/yql/providers/yt/gateway/native/yql_yt_spec.cpp b/ydb/library/yql/providers/yt/gateway/native/yql_yt_spec.cpp index 9fd4b04c5b..2aad48fb86 100644 --- a/ydb/library/yql/providers/yt/gateway/native/yql_yt_spec.cpp +++ b/ydb/library/yql/providers/yt/gateway/native/yql_yt_spec.cpp @@ -191,6 +191,14 @@ void FillSpec(NYT::TNode& spec, spec["annotations"] = *val; } + if (auto val = settings->StartedBy.Get(cluster)) { + spec["started_by"] = *val; + } + + if (auto val = settings->Description.Get(cluster)) { + spec["description"] = *val; + } + if (!opProps.HasFlags(EYtOpProp::IntermediateData)) { if (auto val = settings->MaxJobCount.Get(cluster)) { spec["max_job_count"] = static_cast<i64>(*val); |