diff options
author | aneporada <aneporada@yandex-team.com> | 2025-02-28 13:04:58 +0300 |
---|---|---|
committer | aneporada <aneporada@yandex-team.com> | 2025-02-28 14:15:06 +0300 |
commit | f3797171e71b5544e82f3b9a5331fcb1a0b8e6d9 (patch) | |
tree | 285379e13f5360c917d4d8a1a449fd8b53245e90 | |
parent | f7088503171dc823122e7854865e5292fe42ff23 (diff) | |
download | ydb-f3797171e71b5544e82f3b9a5331fcb1a0b8e6d9.tar.gz |
Extended yt.NightlyCompress pragma
commit_hash:15998f82271873beea6488346b5bb028644b722c
-rw-r--r-- | yt/yql/providers/yt/gateway/file/yql_yt_file.cpp | 11 | ||||
-rw-r--r-- | yt/yql/providers/yt/gateway/native/yql_yt_native.cpp | 12 |
2 files changed, 19 insertions, 4 deletions
diff --git a/yt/yql/providers/yt/gateway/file/yql_yt_file.cpp b/yt/yql/providers/yt/gateway/file/yql_yt_file.cpp index 3a1e127f3d5..f66e356c602 100644 --- a/yt/yql/providers/yt/gateway/file/yql_yt_file.cpp +++ b/yt/yql/providers/yt/gateway/file/yql_yt_file.cpp @@ -924,8 +924,15 @@ public: if (interval || isDuration) { attrs["expiration_timeout"] = isDuration ? duration.MilliSeconds() : interval->MilliSeconds(); } - if (options.Config()->NightlyCompress.Get(cluster).GetOrElse(false)) { - attrs["force_nightly_compress"] = true; + const TMaybe<bool> nightlyCompress = options.Config()->NightlyCompress.Get(cluster); + if (nightlyCompress.Defined()) { + if (*nightlyCompress) { + attrs["force_nightly_compress"] = true; + } else { + NYT::TNode compressSettings = NYT::TNode::CreateMap(); + compressSettings["enabled"] = false; + attrs["nightly_compression_settings"] = compressSettings; + } } } diff --git a/yt/yql/providers/yt/gateway/native/yql_yt_native.cpp b/yt/yql/providers/yt/gateway/native/yql_yt_native.cpp index fb021d149c5..498a2adccac 100644 --- a/yt/yql/providers/yt/gateway/native/yql_yt_native.cpp +++ b/yt/yql/providers/yt/gateway/native/yql_yt_native.cpp @@ -2533,8 +2533,16 @@ private: yqlAttrs["expiration_timeout"] = isDuration ? duration.MilliSeconds() : (*interval).MilliSeconds(); } - if (execCtx->Options_.Config()->NightlyCompress.Get(cluster).GetOrElse(false)) { - yqlAttrs["force_nightly_compress"] = true; + const TMaybe<bool> nightlyCompress = + execCtx->Options_.Config()->NightlyCompress.Get(cluster); + if (nightlyCompress.Defined()) { + if (*nightlyCompress) { + yqlAttrs["force_nightly_compress"] = true; + } else { + NYT::TNode compressSettings = NYT::TNode::CreateMap(); + compressSettings["enabled"] = false; + yqlAttrs["nightly_compression_settings"] = compressSettings; + } } } |