diff --git a/ydb/core/kqp/gateway/behaviour/tablestore/manager.cpp b/ydb/core/kqp/gateway/behaviour/tablestore/manager.cpp index 844ef19344db..a221a60ffd70 100644 --- a/ydb/core/kqp/gateway/behaviour/tablestore/manager.cpp +++ b/ydb/core/kqp/gateway/behaviour/tablestore/manager.cpp @@ -31,6 +31,9 @@ NThreading::TFuture TTableStoreManager return NThreading::MakeFuture(TYqlConclusionStatus::Fail("not implemented")); case EActivityType::Alter: try { + if (!AppData()->ColumnShardConfig.GetAlterObjectEnabled()) { + return NThreading::MakeFuture(TYqlConclusionStatus::Fail("ALTER OBJECT is disabled for column tables")); + } auto actionName = settings.GetFeaturesExtractor().Extract("ACTION"); if (!actionName) { return NThreading::MakeFuture(TYqlConclusionStatus::Fail("can't find ACTION parameter")); diff --git a/ydb/core/kqp/ut/olap/aggregations_ut.cpp b/ydb/core/kqp/ut/olap/aggregations_ut.cpp index dfa8fbd078fd..d8d884555728 100644 --- a/ydb/core/kqp/ut/olap/aggregations_ut.cpp +++ b/ydb/core/kqp/ut/olap/aggregations_ut.cpp @@ -13,7 +13,9 @@ namespace NKikimr::NKqp { Y_UNIT_TEST_SUITE(KqpOlapAggregations) { Y_UNIT_TEST(Aggregation) { - auto settings = TKikimrSettings() + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); diff --git a/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp b/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp index 4aadd5af93c8..a24b770abe5e 100644 --- a/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp +++ b/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp @@ -69,9 +69,10 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) { }; TKikimrSettings GetKikimrSettings() { - NKikimrConfig::TFeatureFlags featureFlags; - featureFlags.SetEnableAlterShardingInColumnShard(true); - return TKikimrSettings().SetWithSampleTables(false).SetFeatureFlags(featureFlags); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + appConfig.MutableFeatureFlags()->SetEnableAlterShardingInColumnShard(true); + return TKikimrSettings().SetWithSampleTables(false).SetAppConfig(appConfig); } class TSharingDataTestCase { diff --git a/ydb/core/kqp/ut/olap/indexes_ut.cpp b/ydb/core/kqp/ut/olap/indexes_ut.cpp index 0f4595691198..35836da0ea8d 100644 --- a/ydb/core/kqp/ut/olap/indexes_ut.cpp +++ b/ydb/core/kqp/ut/olap/indexes_ut.cpp @@ -15,7 +15,9 @@ namespace NKikimr::NKqp { Y_UNIT_TEST_SUITE(KqpOlapIndexes) { Y_UNIT_TEST(IndexesActualization) { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); @@ -96,7 +98,9 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { } Y_UNIT_TEST(CountMinSketchIndex) { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); @@ -239,7 +243,11 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { } Y_UNIT_TEST(SchemeActualizationOnceOnStart) { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings() + .SetAppConfig(appConfig) + .SetWithSampleTables(false); TKikimrRunner kikimr(settings); auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); @@ -340,6 +348,7 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { TTestIndexesScenario& Initialize() { Settings = TKikimrSettings().SetWithSampleTables(false); Settings.AppConfig.MutableColumnShardConfig()->SetReaderClassName("SIMPLE"); + Settings.AppConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); Kikimr = std::make_unique(Settings); return *this; } @@ -552,7 +561,9 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { } Y_UNIT_TEST(IndexesModificationError) { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); TLocalHelper(kikimr).CreateTestOlapTable(); diff --git a/ydb/core/kqp/ut/olap/kqp_olap_ut.cpp b/ydb/core/kqp/ut/olap/kqp_olap_ut.cpp index 4b8b8992dabf..864742b6117f 100644 --- a/ydb/core/kqp/ut/olap/kqp_olap_ut.cpp +++ b/ydb/core/kqp/ut/olap/kqp_olap_ut.cpp @@ -2640,7 +2640,9 @@ Y_UNIT_TEST_SUITE(KqpOlap) { } Y_UNIT_TEST(CompactionPlanner) { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); TLocalHelper(kikimr).CreateTestOlapTable(); @@ -2724,7 +2726,9 @@ Y_UNIT_TEST_SUITE(KqpOlap) { } Y_UNIT_TEST(MetadataMemoryManager) { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); TLocalHelper(kikimr).CreateTestOlapTable(); @@ -2781,7 +2785,9 @@ Y_UNIT_TEST_SUITE(KqpOlap) { } Y_UNIT_TEST(NormalizeAbsentColumn) { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); TLocalHelper testHelper(kikimr); diff --git a/ydb/core/kqp/ut/olap/sparsed_ut.cpp b/ydb/core/kqp/ut/olap/sparsed_ut.cpp index 76ec86c974ff..6d78fb962d2c 100644 --- a/ydb/core/kqp/ut/olap/sparsed_ut.cpp +++ b/ydb/core/kqp/ut/olap/sparsed_ut.cpp @@ -16,7 +16,15 @@ Y_UNIT_TEST_SUITE(KqpOlapSparsed) { class TSparsedDataTest { private: - const TKikimrSettings Settings = TKikimrSettings().SetWithSampleTables(false); + static NKikimrConfig::TAppConfig GetAppConfig() { + NKikimrConfig::TAppConfig config; + config.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + return config; + } + + const TKikimrSettings Settings = TKikimrSettings() + .SetAppConfig(GetAppConfig()) + .SetWithSampleTables(false); TKikimrRunner Kikimr; NKikimr::NYDBTest::TControllers::TGuard CSController; const TString StoreName; @@ -304,7 +312,9 @@ Y_UNIT_TEST_SUITE(KqpOlapSparsed) { } Y_UNIT_TEST(AccessorActualization) { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); diff --git a/ydb/core/kqp/ut/olap/statistics_ut.cpp b/ydb/core/kqp/ut/olap/statistics_ut.cpp index 094fefbd4028..ac6744640449 100644 --- a/ydb/core/kqp/ut/olap/statistics_ut.cpp +++ b/ydb/core/kqp/ut/olap/statistics_ut.cpp @@ -8,7 +8,9 @@ Y_UNIT_TEST_SUITE(KqpOlapStatistics) { Y_UNIT_TEST(StatsUsage) { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); TTypedLocalHelper helper("Utf8", kikimr); @@ -49,7 +51,9 @@ Y_UNIT_TEST_SUITE(KqpOlapStatistics) { Y_UNIT_TEST(StatsUsageNotPK) { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); TTypedLocalHelper helper("Utf8", kikimr); @@ -87,7 +91,9 @@ Y_UNIT_TEST_SUITE(KqpOlapStatistics) { Y_UNIT_TEST(StatsUsageWithTTL) { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); TTypedLocalHelper helper("Utf8", kikimr); diff --git a/ydb/core/kqp/ut/olap/sys_view_ut.cpp b/ydb/core/kqp/ut/olap/sys_view_ut.cpp index 9d12b54efab6..5b46c91afa7b 100644 --- a/ydb/core/kqp/ut/olap/sys_view_ut.cpp +++ b/ydb/core/kqp/ut/olap/sys_view_ut.cpp @@ -116,7 +116,10 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); csController->SetOverrideBlobSplitSettings(NOlap::NSplitter::TSplitSettings()); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); auto settings = TKikimrSettings() + .SetAppConfig(appConfig) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -136,7 +139,10 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { const ui32 rowsCount = 800000; const ui32 groupsCount = 512; { + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); auto settings = TKikimrSettings() + .SetAppConfig(appConfig) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -191,7 +197,10 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { ui64 rawBytesPK1; ui64 bytesPK1; auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); auto settings = TKikimrSettings() + .SetAppConfig(appConfig) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -228,7 +237,9 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { ui64 rawBytes1; ui64 bytes1; auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); TTypedLocalHelper helper("Utf8", kikimr); @@ -259,7 +270,10 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { ui64 rawBytes1; ui64 bytes1; auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); auto settings = TKikimrSettings() + .SetAppConfig(appConfig) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -298,7 +312,11 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { ui64 bytes1; auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); csController->SetSmallSizeDetector(Max()); - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings() + .SetAppConfig(appConfig) + .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); TTypedLocalHelper helper("Utf8", kikimr); diff --git a/ydb/core/kqp/ut/olap/tiering_ut.cpp b/ydb/core/kqp/ut/olap/tiering_ut.cpp index 847091530c4b..dd8727e58890 100644 --- a/ydb/core/kqp/ut/olap/tiering_ut.cpp +++ b/ydb/core/kqp/ut/olap/tiering_ut.cpp @@ -25,9 +25,10 @@ class TTestEvictionBase { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); csController->SetSkipSpecialCheckForEvict(true); - TKikimrSettings runnerSettings; - runnerSettings.WithSampleTables = false; - TestHelper.emplace(runnerSettings); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + TestHelper.emplace(settings); TLocalHelper localHelper(TestHelper->GetKikimr()); // TestHelper->GetRuntime().SetLogPriority(NKikimrServices::FLAT_TX_SCHEMESHARD, NActors::NLog::PRI_DEBUG); // TestHelper->GetRuntime().SetLogPriority(NKikimrServices::TX_COLUMNSHARD, NActors::NLog::PRI_DEBUG); diff --git a/ydb/core/kqp/ut/olap/write_ut.cpp b/ydb/core/kqp/ut/olap/write_ut.cpp index 56b54a0dc6eb..fb5dd5345fd6 100644 --- a/ydb/core/kqp/ut/olap/write_ut.cpp +++ b/ydb/core/kqp/ut/olap/write_ut.cpp @@ -172,7 +172,9 @@ Y_UNIT_TEST_SUITE(KqpOlapWrite) { } Y_UNIT_TEST(DefaultValues) { - auto settings = TKikimrSettings().SetWithSampleTables(false); + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); TTypedLocalHelper helper("Utf8", kikimr); diff --git a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp index f9cd4148955a..f6f9f1854abc 100644 --- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp +++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp @@ -8503,6 +8503,9 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(AddColumnWithTtl) { + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + TKikimrSettings runnerSettings; runnerSettings.WithSampleTables = false; TTestHelper testHelper(runnerSettings); diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto index db3813447cd8..ca41bcc51a16 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -1792,6 +1792,7 @@ message TColumnShardConfig { optional uint64 WritingBufferVolumeMb = 33 [default = 32]; optional uint64 WritingInFlightRequestsCountLimit = 34 [default = 1000]; optional uint64 WritingInFlightRequestBytesLimit = 35 [default = 128000000]; + optional bool AlterObjectEnabled = 36 [default = false]; } message TSchemeShardConfig {