From 1a41dd771a6c835c0e465da41180aef573d5e8f2 Mon Sep 17 00:00:00 2001 From: Evgeny Zverev Date: Sun, 12 Jan 2025 19:00:45 +0000 Subject: [PATCH 1/6] Disable ALTER OBJECT for column tables by default --- .../gateway/behaviour/tablestore/manager.cpp | 3 +++ ydb/core/kqp/ut/olap/aggregations_ut.cpp | 4 +++- ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp | 7 +++--- ydb/core/kqp/ut/olap/indexes_ut.cpp | 19 ++++++++++++---- ydb/core/kqp/ut/olap/kqp_olap_ut.cpp | 12 +++++++--- ydb/core/kqp/ut/olap/sparsed_ut.cpp | 14 ++++++++++-- ydb/core/kqp/ut/olap/statistics_ut.cpp | 12 +++++++--- ydb/core/kqp/ut/olap/sys_view_ut.cpp | 22 +++++++++++++++++-- ydb/core/kqp/ut/olap/tiering_ut.cpp | 7 +++--- ydb/core/kqp/ut/olap/write_ut.cpp | 4 +++- ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp | 3 +++ ydb/core/protos/config.proto | 1 + 12 files changed, 86 insertions(+), 22 deletions(-) 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 5a851b3ab6b7..6607ac695a70 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 4db334e774fa..1d44285e8979 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 f86d7f7fc9bd..57768e97c431 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 34b9daa241de..ae08f8f8b5d1 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 40b4c549542d..b484a12b1a91 100644 --- a/ydb/core/kqp/ut/olap/tiering_ut.cpp +++ b/ydb/core/kqp/ut/olap/tiering_ut.cpp @@ -28,9 +28,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 91c9356b8df2..77a8743ccecf 100644 --- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp +++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp @@ -9222,6 +9222,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 0177bb18d762..8dc434773369 100644 --- a/ydb/core/protos/config.proto +++ b/ydb/core/protos/config.proto @@ -1810,6 +1810,7 @@ message TColumnShardConfig { optional NKikimrSchemeOp.EColumnCodec DefaultCompression = 36; optional int32 DefaultCompressionLevel = 37; optional uint64 MemoryLimitMergeOnCompactionRawData = 38 [default = 512000000]; + optional bool AlterObjectEnabled = 39 [default = false]; } message TSchemeShardConfig { From 8e898cd4bd6af4cfd13f258e88ae0d86729b46bf Mon Sep 17 00:00:00 2001 From: Evgeny Zverev Date: Wed, 22 Jan 2025 10:05:49 +0000 Subject: [PATCH 2/6] fix ut --- ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp | 7 ++++++- ydb/core/kqp/ut/olap/compression_ut.cpp | 13 ++++++++----- ydb/core/statistics/ut_common/ut_common.cpp | 1 + ydb/core/testlib/test_client.h | 4 ++++ 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp b/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp index 1d44285e8979..9304970d7000 100644 --- a/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp +++ b/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp @@ -71,8 +71,13 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) { TKikimrSettings GetKikimrSettings() { NKikimrConfig::TAppConfig appConfig; appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); + NKikimrConfig::TFeatureFlags featureFlags; + featureFlags.SetEnableAlterShardingInColumnShard(true); appConfig.MutableFeatureFlags()->SetEnableAlterShardingInColumnShard(true); - return TKikimrSettings().SetWithSampleTables(false).SetAppConfig(appConfig); + return TKikimrSettings() + .SetWithSampleTables(false) + .SetFeatureFlags(featureFlags) + .SetAppConfig(appConfig); } class TSharingDataTestCase { diff --git a/ydb/core/kqp/ut/olap/compression_ut.cpp b/ydb/core/kqp/ut/olap/compression_ut.cpp index b325324a1f3d..0cc130a21f10 100644 --- a/ydb/core/kqp/ut/olap/compression_ut.cpp +++ b/ydb/core/kqp/ut/olap/compression_ut.cpp @@ -3,9 +3,13 @@ namespace NKikimr::NKqp { Y_UNIT_TEST_SUITE(KqpOlapCompression) { + TKikimrSettings GetSettings(bool enableCompression, bool enableAlterObject) { + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(enableAlterObject); + return TKikimrSettings().SetWithSampleTables(false).SetEnableOlapCompression(enableCompression).SetAppConfig(appConfig); + } Y_UNIT_TEST(DisabledAlterCompression) { - TKikimrSettings settings = TKikimrSettings().SetWithSampleTables(false).SetEnableOlapCompression(false); - TTestHelper testHelper(settings); + TTestHelper testHelper(GetSettings(true, true)); TVector schema = { TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) }; @@ -28,8 +32,7 @@ Y_UNIT_TEST_SUITE(KqpOlapCompression) { } Y_UNIT_TEST(OffCompression) { - TKikimrSettings settings = TKikimrSettings().SetWithSampleTables(false); - TTestHelper testHelper(settings); + TTestHelper testHelper(GetSettings(false, true)); TVector schema = { TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) }; @@ -48,7 +51,7 @@ Y_UNIT_TEST_SUITE(KqpOlapCompression) { Y_UNIT_TEST(TestAlterCompressionTableInTableStore) { TKikimrSettings settings = TKikimrSettings().SetWithSampleTables(false); - TTestHelper testHelper(settings); + TTestHelper testHelper(GetSettings(false, true)); TVector schema = { TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) }; diff --git a/ydb/core/statistics/ut_common/ut_common.cpp b/ydb/core/statistics/ut_common/ut_common.cpp index 667b522f85f2..d25e320df757 100644 --- a/ydb/core/statistics/ut_common/ut_common.cpp +++ b/ydb/core/statistics/ut_common/ut_common.cpp @@ -36,6 +36,7 @@ TTestEnv::TTestEnv(ui32 staticNodes, ui32 dynamicNodes, bool useRealThreads) Settings->SetUseRealThreads(useRealThreads); Settings->AddStoragePoolType("hdd1"); Settings->AddStoragePoolType("hdd2"); + Settings->SetAlterObjectEnabledForColumnTables(true); NKikimrConfig::TFeatureFlags featureFlags; featureFlags.SetEnableStatistics(true); diff --git a/ydb/core/testlib/test_client.h b/ydb/core/testlib/test_client.h index 142bfc3d52bb..52fac0f632ad 100644 --- a/ydb/core/testlib/test_client.h +++ b/ydb/core/testlib/test_client.h @@ -248,6 +248,10 @@ namespace Tests { return *this; } + TServerSettings& SetAlterObjectEnabledForColumnTables(bool enable) { + AppConfig->MutableColumnShardConfig()->SetAlterObjectEnabled(enable); + return *this; + } // Add additional grpc services template From 1f269965ced0d5b11752f4c0ba5351f889289cfb Mon Sep 17 00:00:00 2001 From: Evgeny Zverev Date: Wed, 22 Jan 2025 19:24:05 +0000 Subject: [PATCH 3/6] fix ut --- ydb/core/kqp/ut/common/kqp_ut_common.h | 4 +++ ydb/core/kqp/ut/olap/compression_ut.cpp | 16 +++++++-- ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp | 42 ++++++++++++++---------- 3 files changed, 42 insertions(+), 20 deletions(-) diff --git a/ydb/core/kqp/ut/common/kqp_ut_common.h b/ydb/core/kqp/ut/common/kqp_ut_common.h index 5e392069872a..fc7a03be1e45 100644 --- a/ydb/core/kqp/ut/common/kqp_ut_common.h +++ b/ydb/core/kqp/ut/common/kqp_ut_common.h @@ -121,6 +121,10 @@ struct TKikimrSettings: public TTestFeatureFlagsHolder { TKikimrSettings& SetUseRealThreads(bool value) { UseRealThreads = value; return *this; }; TKikimrSettings& SetEnableForceFollowers(bool value) { EnableForceFollowers = value; return *this; }; TKikimrSettings& SetS3ActorsFactory(std::shared_ptr value) { S3ActorsFactory = std::move(value); return *this; }; + TKikimrSettings& SetAlterObjectEnabledForColumnTables(bool enable) { + AppConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(enable); + return *this; + } }; class TKikimrRunner { diff --git a/ydb/core/kqp/ut/olap/compression_ut.cpp b/ydb/core/kqp/ut/olap/compression_ut.cpp index 0cc130a21f10..45bf5807bd8b 100644 --- a/ydb/core/kqp/ut/olap/compression_ut.cpp +++ b/ydb/core/kqp/ut/olap/compression_ut.cpp @@ -6,10 +6,17 @@ Y_UNIT_TEST_SUITE(KqpOlapCompression) { TKikimrSettings GetSettings(bool enableCompression, bool enableAlterObject) { NKikimrConfig::TAppConfig appConfig; appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(enableAlterObject); - return TKikimrSettings().SetWithSampleTables(false).SetEnableOlapCompression(enableCompression).SetAppConfig(appConfig); + return TKikimrSettings() + .SetWithSampleTables(false) + .SetEnableOlapCompression(enableCompression) + .SetAlterObjectEnabledForColumnTables(enableAlterObject); } Y_UNIT_TEST(DisabledAlterCompression) { - TTestHelper testHelper(GetSettings(true, true)); + auto settings = TKikimrSettings() + .SetEnableOlapCompression(false) + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); + TTestHelper testHelper(settings); TVector schema = { TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) }; @@ -32,7 +39,10 @@ Y_UNIT_TEST_SUITE(KqpOlapCompression) { } Y_UNIT_TEST(OffCompression) { - TTestHelper testHelper(GetSettings(false, true)); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); + TTestHelper testHelper(settings); TVector schema = { TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) }; diff --git a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp index 77a8743ccecf..fa55635d761d 100644 --- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp +++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp @@ -5518,8 +5518,9 @@ Y_UNIT_TEST_SUITE(KqpScheme) { } Y_UNIT_TEST(AlterColumnTableTtl) { - TKikimrSettings runnerSettings; - runnerSettings.WithSampleTables = false; + auto runnerSettings = TKikimrSettings{} + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TKikimrRunner kikimr(runnerSettings); auto db = kikimr.GetTableClient(); auto session = db.CreateSession().GetValueSync().GetSession(); @@ -9225,9 +9226,10 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { NKikimrConfig::TAppConfig appConfig; appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - TKikimrSettings runnerSettings; - runnerSettings.WithSampleTables = false; - TTestHelper testHelper(runnerSettings); + auto settings = TKikimrSettings() + .SetAppConfig(appConfig) + .SetWithSampleTables(false); + TTestHelper testHelper(settings); TVector schema = { TTestHelper::TColumnSchema().SetName("id").SetType(NScheme::NTypeIds::Int32).SetNullable(false), @@ -9487,8 +9489,9 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } */ Y_UNIT_TEST(AddColumnWithStore) { - TKikimrSettings runnerSettings; - runnerSettings.WithSampleTables = false; + auto runnerSettings = TKikimrSettings{} + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); TVector schema = { @@ -9551,8 +9554,9 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(AddPgColumnWithStore) { - TKikimrSettings runnerSettings; - runnerSettings.WithSampleTables = false; + auto runnerSettings = TKikimrSettings{} + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); TVector schema = { @@ -9893,8 +9897,9 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(DropTtlColumn) { - TKikimrSettings runnerSettings; - runnerSettings.WithSampleTables = false; + auto runnerSettings = TKikimrSettings{} + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); TVector schema = { @@ -9958,8 +9963,9 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(DropColumnTableStoreErrors) { - TKikimrSettings runnerSettings; - runnerSettings.WithSampleTables = false; + auto runnerSettings = TKikimrSettings{} + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); TVector schema = { @@ -11409,8 +11415,9 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(DropColumnAndResetTtl) { - TKikimrSettings runnerSettings; - runnerSettings.WithSampleTables = false; + auto runnerSettings = TKikimrSettings{} + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); TVector schema = { @@ -11445,8 +11452,9 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(InitTtlSettingsOnShardStart) { - TKikimrSettings runnerSettings; - runnerSettings.WithSampleTables = false; + auto runnerSettings = TKikimrSettings{} + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); TVector schema = { From 125c0b035c2bf28061c7d25b5f890449eb590ad6 Mon Sep 17 00:00:00 2001 From: Evgeny Zverev Date: Thu, 23 Jan 2025 09:45:18 +0000 Subject: [PATCH 4/6] uniffy altering flag --- ydb/core/kqp/ut/olap/aggregations_ut.cpp | 5 ++-- ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp | 7 ++--- ydb/core/kqp/ut/olap/compression_ut.cpp | 14 +++------- ydb/core/kqp/ut/olap/indexes_ut.cpp | 31 +++++++++++------------ ydb/core/kqp/ut/olap/kqp_olap_ut.cpp | 22 +++++++++------- ydb/core/kqp/ut/olap/sparsed_ut.cpp | 14 +++------- ydb/core/kqp/ut/olap/statistics_ut.cpp | 18 ++++++------- ydb/core/kqp/ut/olap/sys_view_ut.cpp | 26 ++++++------------- ydb/core/kqp/ut/olap/tiering_ut.cpp | 7 +++-- ydb/core/kqp/ut/olap/write_ut.cpp | 6 ++--- ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp | 7 ++--- 11 files changed, 65 insertions(+), 92 deletions(-) diff --git a/ydb/core/kqp/ut/olap/aggregations_ut.cpp b/ydb/core/kqp/ut/olap/aggregations_ut.cpp index 6607ac695a70..cbfc0cd36241 100644 --- a/ydb/core/kqp/ut/olap/aggregations_ut.cpp +++ b/ydb/core/kqp/ut/olap/aggregations_ut.cpp @@ -13,9 +13,8 @@ namespace NKikimr::NKqp { Y_UNIT_TEST_SUITE(KqpOlapAggregations) { Y_UNIT_TEST(Aggregation) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig) + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) .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 9304970d7000..b5c9b009512f 100644 --- a/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp +++ b/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp @@ -69,15 +69,12 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) { }; TKikimrSettings GetKikimrSettings() { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); NKikimrConfig::TFeatureFlags featureFlags; featureFlags.SetEnableAlterShardingInColumnShard(true); - appConfig.MutableFeatureFlags()->SetEnableAlterShardingInColumnShard(true); return TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) .SetWithSampleTables(false) - .SetFeatureFlags(featureFlags) - .SetAppConfig(appConfig); + .SetFeatureFlags(featureFlags); } class TSharingDataTestCase { diff --git a/ydb/core/kqp/ut/olap/compression_ut.cpp b/ydb/core/kqp/ut/olap/compression_ut.cpp index 45bf5807bd8b..91d720ccafc7 100644 --- a/ydb/core/kqp/ut/olap/compression_ut.cpp +++ b/ydb/core/kqp/ut/olap/compression_ut.cpp @@ -3,14 +3,6 @@ namespace NKikimr::NKqp { Y_UNIT_TEST_SUITE(KqpOlapCompression) { - TKikimrSettings GetSettings(bool enableCompression, bool enableAlterObject) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(enableAlterObject); - return TKikimrSettings() - .SetWithSampleTables(false) - .SetEnableOlapCompression(enableCompression) - .SetAlterObjectEnabledForColumnTables(enableAlterObject); - } Y_UNIT_TEST(DisabledAlterCompression) { auto settings = TKikimrSettings() .SetEnableOlapCompression(false) @@ -60,8 +52,10 @@ Y_UNIT_TEST_SUITE(KqpOlapCompression) { } Y_UNIT_TEST(TestAlterCompressionTableInTableStore) { - TKikimrSettings settings = TKikimrSettings().SetWithSampleTables(false); - TTestHelper testHelper(GetSettings(false, true)); + TKikimrSettings settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); + TTestHelper testHelper(settings); TVector schema = { TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false) }; diff --git a/ydb/core/kqp/ut/olap/indexes_ut.cpp b/ydb/core/kqp/ut/olap/indexes_ut.cpp index 57768e97c431..aade3ead7a50 100644 --- a/ydb/core/kqp/ut/olap/indexes_ut.cpp +++ b/ydb/core/kqp/ut/olap/indexes_ut.cpp @@ -15,9 +15,9 @@ namespace NKikimr::NKqp { Y_UNIT_TEST_SUITE(KqpOlapIndexes) { Y_UNIT_TEST(IndexesActualization) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TKikimrRunner kikimr(settings); auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); @@ -98,9 +98,9 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { } Y_UNIT_TEST(CountMinSketchIndex) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TKikimrRunner kikimr(settings); auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); @@ -243,11 +243,9 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { } Y_UNIT_TEST(SchemeActualizationOnceOnStart) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings() - .SetAppConfig(appConfig) - .SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TKikimrRunner kikimr(settings); auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); @@ -346,9 +344,10 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { public: TTestIndexesScenario& Initialize() { - Settings = TKikimrSettings().SetWithSampleTables(false); + Settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); Settings.AppConfig.MutableColumnShardConfig()->SetReaderClassName("SIMPLE"); - Settings.AppConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); Kikimr = std::make_unique(Settings); return *this; } @@ -561,9 +560,9 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { } Y_UNIT_TEST(IndexesModificationError) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .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 ae08f8f8b5d1..f3373bf1ceb6 100644 --- a/ydb/core/kqp/ut/olap/kqp_olap_ut.cpp +++ b/ydb/core/kqp/ut/olap/kqp_olap_ut.cpp @@ -218,6 +218,10 @@ Y_UNIT_TEST_SUITE(KqpOlap) { }; } + Y_UNIT_TEST(AlterObjectDisable) { + + } + Y_UNIT_TEST(SimpleQueryOlap) { auto settings = TKikimrSettings() .SetWithSampleTables(false); @@ -2640,9 +2644,9 @@ Y_UNIT_TEST_SUITE(KqpOlap) { } Y_UNIT_TEST(CompactionPlanner) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TKikimrRunner kikimr(settings); TLocalHelper(kikimr).CreateTestOlapTable(); @@ -2726,9 +2730,9 @@ Y_UNIT_TEST_SUITE(KqpOlap) { } Y_UNIT_TEST(MetadataMemoryManager) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TKikimrRunner kikimr(settings); TLocalHelper(kikimr).CreateTestOlapTable(); @@ -2785,9 +2789,9 @@ Y_UNIT_TEST_SUITE(KqpOlap) { } Y_UNIT_TEST(NormalizeAbsentColumn) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .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 6d78fb962d2c..7149fe36c0f5 100644 --- a/ydb/core/kqp/ut/olap/sparsed_ut.cpp +++ b/ydb/core/kqp/ut/olap/sparsed_ut.cpp @@ -16,14 +16,8 @@ Y_UNIT_TEST_SUITE(KqpOlapSparsed) { class TSparsedDataTest { private: - static NKikimrConfig::TAppConfig GetAppConfig() { - NKikimrConfig::TAppConfig config; - config.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - return config; - } - const TKikimrSettings Settings = TKikimrSettings() - .SetAppConfig(GetAppConfig()) + .SetAlterObjectEnabledForColumnTables(true) .SetWithSampleTables(false); TKikimrRunner Kikimr; NKikimr::NYDBTest::TControllers::TGuard CSController; @@ -312,9 +306,9 @@ Y_UNIT_TEST_SUITE(KqpOlapSparsed) { } Y_UNIT_TEST(AccessorActualization) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .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 ac6744640449..94196d34829e 100644 --- a/ydb/core/kqp/ut/olap/statistics_ut.cpp +++ b/ydb/core/kqp/ut/olap/statistics_ut.cpp @@ -8,9 +8,9 @@ Y_UNIT_TEST_SUITE(KqpOlapStatistics) { Y_UNIT_TEST(StatsUsage) { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); TTypedLocalHelper helper("Utf8", kikimr); @@ -51,9 +51,9 @@ Y_UNIT_TEST_SUITE(KqpOlapStatistics) { Y_UNIT_TEST(StatsUsageNotPK) { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); TTypedLocalHelper helper("Utf8", kikimr); @@ -91,9 +91,9 @@ Y_UNIT_TEST_SUITE(KqpOlapStatistics) { Y_UNIT_TEST(StatsUsageWithTTL) { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .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 5b46c91afa7b..3e2bb528eb51 100644 --- a/ydb/core/kqp/ut/olap/sys_view_ut.cpp +++ b/ydb/core/kqp/ut/olap/sys_view_ut.cpp @@ -116,10 +116,8 @@ 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) + .SetAlterObjectEnabledForColumnTables(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -139,10 +137,8 @@ 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) + .SetAlterObjectEnabledForColumnTables(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -197,10 +193,8 @@ 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) + .SetAlterObjectEnabledForColumnTables(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -237,9 +231,9 @@ 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); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); TTypedLocalHelper helper("Utf8", kikimr); @@ -270,10 +264,8 @@ 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) + .SetAlterObjectEnabledForColumnTables(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -312,10 +304,8 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { ui64 bytes1; auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); csController->SetSmallSizeDetector(Max()); - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); auto settings = TKikimrSettings() - .SetAppConfig(appConfig) + .SetAlterObjectEnabledForColumnTables(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); diff --git a/ydb/core/kqp/ut/olap/tiering_ut.cpp b/ydb/core/kqp/ut/olap/tiering_ut.cpp index b484a12b1a91..bab48edce5ba 100644 --- a/ydb/core/kqp/ut/olap/tiering_ut.cpp +++ b/ydb/core/kqp/ut/olap/tiering_ut.cpp @@ -27,10 +27,9 @@ class TTestEvictionBase { void RunTest() { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); csController->SetSkipSpecialCheckForEvict(true); - - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings() + .SetAlterObjectEnabledForColumnTables(true) + .SetWithSampleTables(false); TestHelper.emplace(settings); TLocalHelper localHelper(TestHelper->GetKikimr()); // TestHelper->GetRuntime().SetLogPriority(NKikimrServices::FLAT_TX_SCHEMESHARD, 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 fb5dd5345fd6..7f1773e04f4b 100644 --- a/ydb/core/kqp/ut/olap/write_ut.cpp +++ b/ydb/core/kqp/ut/olap/write_ut.cpp @@ -172,9 +172,9 @@ Y_UNIT_TEST_SUITE(KqpOlapWrite) { } Y_UNIT_TEST(DefaultValues) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - auto settings = TKikimrSettings().SetAppConfig(appConfig).SetWithSampleTables(false); + auto settings = TKikimrSettings{} + .SetAlterObjectEnabledForColumnTables(true) + .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 fa55635d761d..85b6cbe56e18 100644 --- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp +++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp @@ -9223,11 +9223,8 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(AddColumnWithTtl) { - NKikimrConfig::TAppConfig appConfig; - appConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(true); - - auto settings = TKikimrSettings() - .SetAppConfig(appConfig) + auto settings = TKikimrSettings{} + .SetAlterObjectEnabledForColumnTables(true) .SetWithSampleTables(false); TTestHelper testHelper(settings); From ac7ce3241c4a42dfc1ff2bb8ab2db1443fb60b1c Mon Sep 17 00:00:00 2001 From: Evgeny Zverev Date: Thu, 23 Jan 2025 14:16:43 +0000 Subject: [PATCH 5/6] fix scenario tests --- ydb/tests/olap/scenario/conftest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ydb/tests/olap/scenario/conftest.py b/ydb/tests/olap/scenario/conftest.py index 797335b750ef..057931a7f6fa 100644 --- a/ydb/tests/olap/scenario/conftest.py +++ b/ydb/tests/olap/scenario/conftest.py @@ -31,7 +31,11 @@ def __init__(self, endpoint, database): self._database = database self._mon_port = 8765 else: - config = KikimrConfigGenerator() + config = KikimrConfigGenerator( + column_shard_config={ + 'alter_object_enabled': True, + } + ) cluster = KiKiMR(configurator=config) cluster.start() node = cluster.nodes[1] From fca875983ac76ce27906d7eb0acde3daef54eb2a Mon Sep 17 00:00:00 2001 From: Evgeny Zverev Date: Thu, 23 Jan 2025 19:48:33 +0000 Subject: [PATCH 6/6] add ut for disabled --- ydb/core/kqp/ut/common/kqp_ut_common.h | 2 +- ydb/core/kqp/ut/olap/aggregations_ut.cpp | 2 +- ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp | 2 +- ydb/core/kqp/ut/olap/compression_ut.cpp | 6 ++-- ydb/core/kqp/ut/olap/indexes_ut.cpp | 10 +++---- ydb/core/kqp/ut/olap/kqp_olap_ut.cpp | 22 ++++++++++---- ydb/core/kqp/ut/olap/sparsed_ut.cpp | 4 +-- ydb/core/kqp/ut/olap/statistics_ut.cpp | 6 ++-- ydb/core/kqp/ut/olap/sys_view_ut.cpp | 12 ++++---- ydb/core/kqp/ut/olap/tiering_ut.cpp | 2 +- ydb/core/kqp/ut/olap/write_ut.cpp | 4 +-- ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp | 32 ++++++++++----------- ydb/core/statistics/ut_common/ut_common.cpp | 2 +- ydb/core/testlib/test_client.h | 2 +- 14 files changed, 60 insertions(+), 48 deletions(-) diff --git a/ydb/core/kqp/ut/common/kqp_ut_common.h b/ydb/core/kqp/ut/common/kqp_ut_common.h index fc7a03be1e45..1a7bd65c5a9d 100644 --- a/ydb/core/kqp/ut/common/kqp_ut_common.h +++ b/ydb/core/kqp/ut/common/kqp_ut_common.h @@ -121,7 +121,7 @@ struct TKikimrSettings: public TTestFeatureFlagsHolder { TKikimrSettings& SetUseRealThreads(bool value) { UseRealThreads = value; return *this; }; TKikimrSettings& SetEnableForceFollowers(bool value) { EnableForceFollowers = value; return *this; }; TKikimrSettings& SetS3ActorsFactory(std::shared_ptr value) { S3ActorsFactory = std::move(value); return *this; }; - TKikimrSettings& SetAlterObjectEnabledForColumnTables(bool enable) { + TKikimrSettings& SetColumnShardAlterObjectEnabled(bool enable) { AppConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(enable); return *this; } diff --git a/ydb/core/kqp/ut/olap/aggregations_ut.cpp b/ydb/core/kqp/ut/olap/aggregations_ut.cpp index cbfc0cd36241..01f7b8e2a64e 100644 --- a/ydb/core/kqp/ut/olap/aggregations_ut.cpp +++ b/ydb/core/kqp/ut/olap/aggregations_ut.cpp @@ -14,7 +14,7 @@ namespace NKikimr::NKqp { Y_UNIT_TEST_SUITE(KqpOlapAggregations) { Y_UNIT_TEST(Aggregation) { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .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 b5c9b009512f..da3a403f19b8 100644 --- a/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp +++ b/ydb/core/kqp/ut/olap/blobs_sharing_ut.cpp @@ -72,7 +72,7 @@ Y_UNIT_TEST_SUITE(KqpOlapBlobsSharing) { NKikimrConfig::TFeatureFlags featureFlags; featureFlags.SetEnableAlterShardingInColumnShard(true); return TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false) .SetFeatureFlags(featureFlags); } diff --git a/ydb/core/kqp/ut/olap/compression_ut.cpp b/ydb/core/kqp/ut/olap/compression_ut.cpp index 91d720ccafc7..4b4ed13264cf 100644 --- a/ydb/core/kqp/ut/olap/compression_ut.cpp +++ b/ydb/core/kqp/ut/olap/compression_ut.cpp @@ -6,7 +6,7 @@ Y_UNIT_TEST_SUITE(KqpOlapCompression) { Y_UNIT_TEST(DisabledAlterCompression) { auto settings = TKikimrSettings() .SetEnableOlapCompression(false) - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TTestHelper testHelper(settings); TVector schema = { @@ -32,7 +32,7 @@ Y_UNIT_TEST_SUITE(KqpOlapCompression) { Y_UNIT_TEST(OffCompression) { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TTestHelper testHelper(settings); TVector schema = { @@ -53,7 +53,7 @@ Y_UNIT_TEST_SUITE(KqpOlapCompression) { Y_UNIT_TEST(TestAlterCompressionTableInTableStore) { TKikimrSettings settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TTestHelper testHelper(settings); TVector schema = { diff --git a/ydb/core/kqp/ut/olap/indexes_ut.cpp b/ydb/core/kqp/ut/olap/indexes_ut.cpp index aade3ead7a50..3961863dc89f 100644 --- a/ydb/core/kqp/ut/olap/indexes_ut.cpp +++ b/ydb/core/kqp/ut/olap/indexes_ut.cpp @@ -16,7 +16,7 @@ namespace NKikimr::NKqp { Y_UNIT_TEST_SUITE(KqpOlapIndexes) { Y_UNIT_TEST(IndexesActualization) { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); @@ -99,7 +99,7 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { Y_UNIT_TEST(CountMinSketchIndex) { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); @@ -244,7 +244,7 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { Y_UNIT_TEST(SchemeActualizationOnceOnStart) { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); @@ -345,7 +345,7 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { public: TTestIndexesScenario& Initialize() { Settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); Settings.AppConfig.MutableColumnShardConfig()->SetReaderClassName("SIMPLE"); Kikimr = std::make_unique(Settings); @@ -561,7 +561,7 @@ Y_UNIT_TEST_SUITE(KqpOlapIndexes) { Y_UNIT_TEST(IndexesModificationError) { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); diff --git a/ydb/core/kqp/ut/olap/kqp_olap_ut.cpp b/ydb/core/kqp/ut/olap/kqp_olap_ut.cpp index f3373bf1ceb6..58bf88da603c 100644 --- a/ydb/core/kqp/ut/olap/kqp_olap_ut.cpp +++ b/ydb/core/kqp/ut/olap/kqp_olap_ut.cpp @@ -218,8 +218,20 @@ Y_UNIT_TEST_SUITE(KqpOlap) { }; } - Y_UNIT_TEST(AlterObjectDisable) { - + Y_UNIT_TEST(AlterObjectDisabled) { + auto settings = TKikimrSettings() + .SetWithSampleTables(false); + TKikimrRunner kikimr(settings); + TLocalHelper(kikimr).CreateTestOlapTableWithoutStore(); + + auto tableClient = kikimr.GetTableClient(); + auto session = tableClient.CreateSession().GetValueSync().GetSession(); + auto alterResult = session.ExecuteSchemeQuery( + "ALTER OBJECT `/Root/olapTable` (TYPE TABLE) SET (ACTION=ALTER_COLUMN, NAME=message, `SERIALIZER.CLASS_NAME`=`ARROW_SERIALIZER`, `COMPRESSION.TYPE`=`zstd`, `COMPRESSION.LEVEL`=`4`)" + ).GetValueSync(); + UNIT_ASSERT_VALUES_EQUAL(alterResult.GetStatus(), NYdb::EStatus::GENERIC_ERROR); + UNIT_ASSERT_STRING_CONTAINS_C(alterResult.GetIssues().ToString(), "Error: ALTER OBJECT is disabled for column tables", alterResult.GetIssues().ToString()); + } Y_UNIT_TEST(SimpleQueryOlap) { @@ -2645,7 +2657,7 @@ Y_UNIT_TEST_SUITE(KqpOlap) { Y_UNIT_TEST(CompactionPlanner) { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); @@ -2731,7 +2743,7 @@ Y_UNIT_TEST_SUITE(KqpOlap) { Y_UNIT_TEST(MetadataMemoryManager) { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); @@ -2790,7 +2802,7 @@ Y_UNIT_TEST_SUITE(KqpOlap) { Y_UNIT_TEST(NormalizeAbsentColumn) { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .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 7149fe36c0f5..147856f2d1e2 100644 --- a/ydb/core/kqp/ut/olap/sparsed_ut.cpp +++ b/ydb/core/kqp/ut/olap/sparsed_ut.cpp @@ -17,7 +17,7 @@ Y_UNIT_TEST_SUITE(KqpOlapSparsed) { class TSparsedDataTest { private: const TKikimrSettings Settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner Kikimr; NKikimr::NYDBTest::TControllers::TGuard CSController; @@ -307,7 +307,7 @@ Y_UNIT_TEST_SUITE(KqpOlapSparsed) { Y_UNIT_TEST(AccessorActualization) { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); diff --git a/ydb/core/kqp/ut/olap/statistics_ut.cpp b/ydb/core/kqp/ut/olap/statistics_ut.cpp index 94196d34829e..3000e243b9ea 100644 --- a/ydb/core/kqp/ut/olap/statistics_ut.cpp +++ b/ydb/core/kqp/ut/olap/statistics_ut.cpp @@ -9,7 +9,7 @@ Y_UNIT_TEST_SUITE(KqpOlapStatistics) { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -52,7 +52,7 @@ Y_UNIT_TEST_SUITE(KqpOlapStatistics) { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -92,7 +92,7 @@ Y_UNIT_TEST_SUITE(KqpOlapStatistics) { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); diff --git a/ydb/core/kqp/ut/olap/sys_view_ut.cpp b/ydb/core/kqp/ut/olap/sys_view_ut.cpp index 3e2bb528eb51..c0c362a66635 100644 --- a/ydb/core/kqp/ut/olap/sys_view_ut.cpp +++ b/ydb/core/kqp/ut/olap/sys_view_ut.cpp @@ -117,7 +117,7 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); csController->SetOverrideBlobSplitSettings(NOlap::NSplitter::TSplitSettings()); auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -138,7 +138,7 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { const ui32 groupsCount = 512; { auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -194,7 +194,7 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { ui64 bytesPK1; auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -232,7 +232,7 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { ui64 bytes1; auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -265,7 +265,7 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { ui64 bytes1; auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); @@ -305,7 +305,7 @@ Y_UNIT_TEST_SUITE(KqpOlapSysView) { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); csController->SetSmallSizeDetector(Max()); auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); diff --git a/ydb/core/kqp/ut/olap/tiering_ut.cpp b/ydb/core/kqp/ut/olap/tiering_ut.cpp index bab48edce5ba..8da5e42540dd 100644 --- a/ydb/core/kqp/ut/olap/tiering_ut.cpp +++ b/ydb/core/kqp/ut/olap/tiering_ut.cpp @@ -28,7 +28,7 @@ class TTestEvictionBase { auto csController = NYDBTest::TControllers::RegisterCSControllerGuard(); csController->SetSkipSpecialCheckForEvict(true); auto settings = TKikimrSettings() - .SetAlterObjectEnabledForColumnTables(true) + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TestHelper.emplace(settings); TLocalHelper localHelper(TestHelper->GetKikimr()); diff --git a/ydb/core/kqp/ut/olap/write_ut.cpp b/ydb/core/kqp/ut/olap/write_ut.cpp index 7f1773e04f4b..5febb351814c 100644 --- a/ydb/core/kqp/ut/olap/write_ut.cpp +++ b/ydb/core/kqp/ut/olap/write_ut.cpp @@ -172,8 +172,8 @@ Y_UNIT_TEST_SUITE(KqpOlapWrite) { } Y_UNIT_TEST(DefaultValues) { - auto settings = TKikimrSettings{} - .SetAlterObjectEnabledForColumnTables(true) + auto settings = TKikimrSettings() + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(settings); Tests::NCommon::TLoggerInit(kikimr).Initialize(); diff --git a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp index 85b6cbe56e18..1583fbbccb6f 100644 --- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp +++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp @@ -5518,8 +5518,8 @@ Y_UNIT_TEST_SUITE(KqpScheme) { } Y_UNIT_TEST(AlterColumnTableTtl) { - auto runnerSettings = TKikimrSettings{} - .SetAlterObjectEnabledForColumnTables(true) + auto runnerSettings = TKikimrSettings() + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TKikimrRunner kikimr(runnerSettings); auto db = kikimr.GetTableClient(); @@ -9223,8 +9223,8 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(AddColumnWithTtl) { - auto settings = TKikimrSettings{} - .SetAlterObjectEnabledForColumnTables(true) + auto settings = TKikimrSettings() + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TTestHelper testHelper(settings); @@ -9486,8 +9486,8 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } */ Y_UNIT_TEST(AddColumnWithStore) { - auto runnerSettings = TKikimrSettings{} - .SetAlterObjectEnabledForColumnTables(true) + auto runnerSettings = TKikimrSettings() + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); @@ -9551,8 +9551,8 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(AddPgColumnWithStore) { - auto runnerSettings = TKikimrSettings{} - .SetAlterObjectEnabledForColumnTables(true) + auto runnerSettings = TKikimrSettings() + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); @@ -9894,8 +9894,8 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(DropTtlColumn) { - auto runnerSettings = TKikimrSettings{} - .SetAlterObjectEnabledForColumnTables(true) + auto runnerSettings = TKikimrSettings() + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); @@ -9960,8 +9960,8 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(DropColumnTableStoreErrors) { - auto runnerSettings = TKikimrSettings{} - .SetAlterObjectEnabledForColumnTables(true) + auto runnerSettings = TKikimrSettings() + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); @@ -11412,8 +11412,8 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(DropColumnAndResetTtl) { - auto runnerSettings = TKikimrSettings{} - .SetAlterObjectEnabledForColumnTables(true) + auto runnerSettings = TKikimrSettings() + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); @@ -11449,8 +11449,8 @@ Y_UNIT_TEST_SUITE(KqpOlapScheme) { } Y_UNIT_TEST(InitTtlSettingsOnShardStart) { - auto runnerSettings = TKikimrSettings{} - .SetAlterObjectEnabledForColumnTables(true) + auto runnerSettings = TKikimrSettings() + .SetColumnShardAlterObjectEnabled(true) .SetWithSampleTables(false); TTestHelper testHelper(runnerSettings); diff --git a/ydb/core/statistics/ut_common/ut_common.cpp b/ydb/core/statistics/ut_common/ut_common.cpp index d25e320df757..d7c580f5fa41 100644 --- a/ydb/core/statistics/ut_common/ut_common.cpp +++ b/ydb/core/statistics/ut_common/ut_common.cpp @@ -36,7 +36,7 @@ TTestEnv::TTestEnv(ui32 staticNodes, ui32 dynamicNodes, bool useRealThreads) Settings->SetUseRealThreads(useRealThreads); Settings->AddStoragePoolType("hdd1"); Settings->AddStoragePoolType("hdd2"); - Settings->SetAlterObjectEnabledForColumnTables(true); + Settings->SetColumnShardAlterObjectEnabled(true); NKikimrConfig::TFeatureFlags featureFlags; featureFlags.SetEnableStatistics(true); diff --git a/ydb/core/testlib/test_client.h b/ydb/core/testlib/test_client.h index 52fac0f632ad..a145e7fe4989 100644 --- a/ydb/core/testlib/test_client.h +++ b/ydb/core/testlib/test_client.h @@ -248,7 +248,7 @@ namespace Tests { return *this; } - TServerSettings& SetAlterObjectEnabledForColumnTables(bool enable) { + TServerSettings& SetColumnShardAlterObjectEnabled(bool enable) { AppConfig->MutableColumnShardConfig()->SetAlterObjectEnabled(enable); return *this; }