Skip to content

Commit 0c40fe0

Browse files
nepalblinkov
authored andcommitted
Extended yt.NightlyCompress pragma
commit_hash:15998f82271873beea6488346b5bb028644b722c
1 parent 26eacfb commit 0c40fe0

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

yt/yql/providers/yt/gateway/file/yql_yt_file.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,8 +924,15 @@ class TYtFileGateway : public IYtGateway {
924924
if (interval || isDuration) {
925925
attrs["expiration_timeout"] = isDuration ? duration.MilliSeconds() : interval->MilliSeconds();
926926
}
927-
if (options.Config()->NightlyCompress.Get(cluster).GetOrElse(false)) {
928-
attrs["force_nightly_compress"] = true;
927+
const TMaybe<bool> nightlyCompress = options.Config()->NightlyCompress.Get(cluster);
928+
if (nightlyCompress.Defined()) {
929+
if (*nightlyCompress) {
930+
attrs["force_nightly_compress"] = true;
931+
} else {
932+
NYT::TNode compressSettings = NYT::TNode::CreateMap();
933+
compressSettings["enabled"] = false;
934+
attrs["nightly_compression_settings"] = compressSettings;
935+
}
929936
}
930937
}
931938

yt/yql/providers/yt/gateway/native/yql_yt_native.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,8 +2533,16 @@ class TYtNativeGateway : public IYtGateway {
25332533
yqlAttrs["expiration_timeout"] = isDuration ? duration.MilliSeconds()
25342534
: (*interval).MilliSeconds();
25352535
}
2536-
if (execCtx->Options_.Config()->NightlyCompress.Get(cluster).GetOrElse(false)) {
2537-
yqlAttrs["force_nightly_compress"] = true;
2536+
const TMaybe<bool> nightlyCompress =
2537+
execCtx->Options_.Config()->NightlyCompress.Get(cluster);
2538+
if (nightlyCompress.Defined()) {
2539+
if (*nightlyCompress) {
2540+
yqlAttrs["force_nightly_compress"] = true;
2541+
} else {
2542+
NYT::TNode compressSettings = NYT::TNode::CreateMap();
2543+
compressSettings["enabled"] = false;
2544+
yqlAttrs["nightly_compression_settings"] = compressSettings;
2545+
}
25382546
}
25392547
}
25402548

0 commit comments

Comments
 (0)