Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
zverevgeny committed Jan 23, 2025
1 parent 8e898cd commit 1f26996
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 20 deletions.
4 changes: 4 additions & 0 deletions ydb/core/kqp/ut/common/kqp_ut_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ struct TKikimrSettings: public TTestFeatureFlagsHolder<TKikimrSettings> {
TKikimrSettings& SetUseRealThreads(bool value) { UseRealThreads = value; return *this; };
TKikimrSettings& SetEnableForceFollowers(bool value) { EnableForceFollowers = value; return *this; };
TKikimrSettings& SetS3ActorsFactory(std::shared_ptr<NYql::NDq::IS3ActorsFactory> value) { S3ActorsFactory = std::move(value); return *this; };
TKikimrSettings& SetAlterObjectEnabledForColumnTables(bool enable) {
AppConfig.MutableColumnShardConfig()->SetAlterObjectEnabled(enable);
return *this;
}
};

class TKikimrRunner {
Expand Down
16 changes: 13 additions & 3 deletions ydb/core/kqp/ut/olap/compression_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TTestHelper::TColumnSchema> schema = {
TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false)
};
Expand All @@ -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<TTestHelper::TColumnSchema> schema = {
TTestHelper::TColumnSchema().SetName("pk_int").SetType(NScheme::NTypeIds::Uint64).SetNullable(false)
};
Expand Down
42 changes: 25 additions & 17 deletions ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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<TTestHelper::TColumnSchema> schema = {
TTestHelper::TColumnSchema().SetName("id").SetType(NScheme::NTypeIds::Int32).SetNullable(false),
Expand Down Expand Up @@ -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<TTestHelper::TColumnSchema> schema = {
Expand Down Expand Up @@ -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<TTestHelper::TColumnSchema> schema = {
Expand Down Expand Up @@ -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<TTestHelper::TColumnSchema> schema = {
Expand Down Expand Up @@ -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<TTestHelper::TColumnSchema> schema = {
Expand Down Expand Up @@ -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<TTestHelper::TColumnSchema> schema = {
Expand Down Expand Up @@ -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<TTestHelper::TColumnSchema> schema = {
Expand Down

0 comments on commit 1f26996

Please sign in to comment.