Skip to content

Commit

Permalink
Add YT pragmas for description and started_by
Browse files Browse the repository at this point in the history
  • Loading branch information
avevad committed Jan 10, 2024
1 parent eee3fb5 commit f5b5c95
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ydb/library/yql/providers/yt/common/yql_yt_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions ydb/library/yql/providers/yt/common/yql_yt_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions ydb/library/yql/providers/yt/gateway/native/yql_yt_spec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f5b5c95

Please sign in to comment.