File tree Expand file tree Collapse file tree 5 files changed +33
-0
lines changed
tx/schemeshard/olap/operations Expand file tree Collapse file tree 5 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ TKikimrRunner::TKikimrRunner(const TKikimrSettings& settings) {
133
133
ServerSettings->SetUseRealThreads (settings.UseRealThreads );
134
134
ServerSettings->SetEnableTablePgTypes (true );
135
135
ServerSettings->SetEnablePgSyntax (true );
136
+ ServerSettings->SetEnableOlapCompression (true );
136
137
ServerSettings->S3ActorsFactory = settings.S3ActorsFactory ;
137
138
138
139
if (settings.Storage ) {
Original file line number Diff line number Diff line change @@ -158,4 +158,5 @@ message TFeatureFlags {
158
158
optional bool EnablePgSyntax = 139 [default = true ];
159
159
optional bool EnableTieringInColumnShard = 140 [default = false ];
160
160
optional bool EnableMetadataObjectsOnServerless = 141 [default = true ];
161
+ optional bool EnableOlapCompression = 142 [default = false ];
161
162
}
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ class TTestFeatureFlagsHolder {
67
67
FEATURE_FLAG_SETTER (EnablePgSyntax)
68
68
FEATURE_FLAG_SETTER (EnableTieringInColumnShard)
69
69
FEATURE_FLAG_SETTER (EnableMetadataObjectsOnServerless)
70
+ FEATURE_FLAG_SETTER (EnableOlapCompression)
70
71
71
72
#undef FEATURE_FLAG_SETTER
72
73
};
Original file line number Diff line number Diff line change @@ -11,6 +11,16 @@ namespace NKikimr::NSchemeShard::NOlap::NAlter {
11
11
class ISSEntityUpdate {
12
12
private:
13
13
bool Initialized = false ;
14
+
15
+ bool IsAlterCompression (const TUpdateInitializationContext& context) const {
16
+ for (const auto & alterColumn : context.GetModification ()->GetAlterColumnTable ().GetAlterSchema ().GetAlterColumns ()) {
17
+ if (alterColumn.HasSerializer ()) {
18
+ return true ;
19
+ }
20
+ }
21
+ return false ;
22
+ }
23
+
14
24
protected:
15
25
virtual TConclusionStatus DoInitialize (const TUpdateInitializationContext& context) = 0;
16
26
virtual TConclusionStatus DoStart (const TUpdateStartContext& context) = 0;
@@ -44,6 +54,9 @@ class ISSEntityUpdate {
44
54
45
55
TConclusionStatus Initialize (const TUpdateInitializationContext& context) {
46
56
AFL_VERIFY (!Initialized);
57
+ if (!AppData ()->FeatureFlags .GetEnableOlapCompression () && IsAlterCompression (context)) {
58
+ return TConclusionStatus::Fail (" Compression is disabled for OLAP tables" );
59
+ }
47
60
auto result = DoInitialize (context);
48
61
if (result.IsSuccess ()) {
49
62
Initialized = true ;
Original file line number Diff line number Diff line change @@ -436,6 +436,18 @@ class TAlterOlapStore: public TSubOperation {
436
436
}
437
437
}
438
438
439
+ bool IsAlterCompression () const {
440
+ const auto & alter = Transaction.GetAlterColumnStore ();
441
+ for (const auto & alterSchema : alter.GetAlterSchemaPresets ()) {
442
+ for (const auto & alterColumn : alterSchema.GetAlterSchema ().GetAlterColumns ()) {
443
+ if (alterColumn.HasSerializer ()) {
444
+ return true ;
445
+ }
446
+ }
447
+ }
448
+ return false ;
449
+ }
450
+
439
451
public:
440
452
using TSubOperation::TSubOperation;
441
453
@@ -460,6 +472,11 @@ class TAlterOlapStore: public TSubOperation {
460
472
return result;
461
473
}
462
474
475
+ if (!AppData ()->FeatureFlags .GetEnableOlapCompression () && IsAlterCompression ()) {
476
+ result->SetError (NKikimrScheme::StatusPreconditionFailed, " Compression is disabled for OLAP tables" );
477
+ return result;
478
+ }
479
+
463
480
TPath parentPath = TPath::Resolve (parentPathStr, context.SS );
464
481
TPath path = parentPath.Dive (name);
465
482
{
You can’t perform that action at this time.
0 commit comments