diff --git a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp index e42dae725d01..466306d4991e 100644 --- a/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp +++ b/ydb/core/kqp/ut/scheme/kqp_scheme_ut.cpp @@ -1947,8 +1947,7 @@ Y_UNIT_TEST_SUITE(KqpScheme) { } Y_UNIT_TEST(CreateTableWithPartitionAtKeysUuid) { - TKikimrSettings kikimrSettings = TKikimrSettings() - .SetEnableUuidAsPrimaryKey(true); + TKikimrSettings kikimrSettings; TKikimrRunner kikimr(kikimrSettings); auto db = kikimr.GetTableClient(); auto session = db.CreateSession().GetValueSync().GetSession(); @@ -1992,8 +1991,7 @@ Y_UNIT_TEST_SUITE(KqpScheme) { } Y_UNIT_TEST(CreateTableWithUniformPartitionsUuid) { - TKikimrSettings kikimrSettings = TKikimrSettings() - .SetEnableUuidAsPrimaryKey(true); + TKikimrSettings kikimrSettings; TKikimrRunner kikimr(kikimrSettings); auto db = kikimr.GetTableClient(); auto session = db.CreateSession().GetValueSync().GetSession(); diff --git a/ydb/core/kqp/ut/yql/kqp_yql_ut.cpp b/ydb/core/kqp/ut/yql/kqp_yql_ut.cpp index 247704928cfb..17c7fa65c0fc 100644 --- a/ydb/core/kqp/ut/yql/kqp_yql_ut.cpp +++ b/ydb/core/kqp/ut/yql/kqp_yql_ut.cpp @@ -613,6 +613,7 @@ Y_UNIT_TEST_SUITE(KqpYql) { appConfig.MutableTableServiceConfig()->SetEnablePreparedDdl(true); auto setting = NKikimrKqp::TKqpSetting(); auto serverSettings = TKikimrSettings() + .SetEnableUuidAsPrimaryKey(false) .SetAppConfig(appConfig) .SetKqpSettings({setting}); TKikimrRunner kikimr(serverSettings.SetWithSampleTables(false)); @@ -684,7 +685,6 @@ Y_UNIT_TEST_SUITE(KqpYql) { auto setting = NKikimrKqp::TKqpSetting(); auto serverSettings = TKikimrSettings() .SetAppConfig(appConfig) - .SetEnableUuidAsPrimaryKey(true) .SetKqpSettings({setting}); TKikimrRunner kikimr(serverSettings.SetWithSampleTables(false)); @@ -833,7 +833,6 @@ Y_UNIT_TEST_SUITE(KqpYql) { auto setting = NKikimrKqp::TKqpSetting(); auto serverSettings = TKikimrSettings() .SetAppConfig(appConfig) - .SetEnableUuidAsPrimaryKey(true) .SetKqpSettings({setting}); TKikimrRunner kikimr(serverSettings.SetWithSampleTables(false)); @@ -890,7 +889,6 @@ Y_UNIT_TEST_SUITE(KqpYql) { auto setting = NKikimrKqp::TKqpSetting(); auto serverSettings = TKikimrSettings() .SetAppConfig(appConfig) - .SetEnableUuidAsPrimaryKey(true) .SetKqpSettings({setting}); TKikimrRunner kikimr(serverSettings.SetWithSampleTables(false)); @@ -917,7 +915,6 @@ Y_UNIT_TEST_SUITE(KqpYql) { Y_UNIT_TEST(UuidPrimaryKeyBulkUpsert) { auto settings = TKikimrSettings() - .SetEnableUuidAsPrimaryKey(true) .SetWithSampleTables(false); auto kikimr = TKikimrRunner{settings}; auto db = kikimr.GetTableClient(); diff --git a/ydb/core/protos/feature_flags.proto b/ydb/core/protos/feature_flags.proto index 8674daffc41c..dc497918cbec 100644 --- a/ydb/core/protos/feature_flags.proto +++ b/ydb/core/protos/feature_flags.proto @@ -119,7 +119,7 @@ message TFeatureFlags { optional bool EnableUniqConstraint = 104 [default = false]; optional bool EnableChangefeedDebeziumJsonFormat = 105 [default = false]; optional bool EnableStatistics = 106 [default = false]; - optional bool EnableUuidAsPrimaryKey = 107 [default = false]; + optional bool EnableUuidAsPrimaryKey = 107 [default = true]; optional bool EnableTablePgTypes = 108 [default = false]; optional bool EnableLocalDBBtreeIndex = 109 [default = false]; optional bool EnablePDiskHighHDDInFlight = 110 [default = false]; diff --git a/ydb/tests/functional/replication/main.cpp b/ydb/tests/functional/replication/main.cpp index ef643253d302..da50717b7ef8 100644 --- a/ydb/tests/functional/replication/main.cpp +++ b/ydb/tests/functional/replication/main.cpp @@ -42,10 +42,11 @@ Y_UNIT_TEST_SUITE(Replication) auto res = session.ExecuteSchemeQuery(R"( CREATE TABLE `/local/ProducerUuidValue` ( Key Uint32, + Key2 Uuid, v01 Uuid, v02 Uuid NOT NULL, v03 Double, - PRIMARY KEY (Key) + PRIMARY KEY (Key, Key2) ); )").GetValueSync(); UNIT_ASSERT_C(res.IsSuccess(), res.GetIssues().ToString()); @@ -57,8 +58,9 @@ Y_UNIT_TEST_SUITE(Replication) auto s = sessionResult.GetSession(); { - const TString query = "UPSERT INTO ProducerUuidValue (Key,v01,v02,v03) VALUES" + const TString query = "UPSERT INTO ProducerUuidValue (Key,Key2,v01,v02,v03) VALUES" "(1, " + "CAST(\"5b99a330-04ef-4f1a-9b64-ba6d5f44ea00\" as Uuid), " "CAST(\"5b99a330-04ef-4f1a-9b64-ba6d5f44ea01\" as Uuid), " "UNWRAP(CAST(\"5b99a330-04ef-4f1a-9b64-ba6d5f44ea02\" as Uuid)), " "CAST(\"311111111113.222222223\" as Double) " @@ -88,6 +90,7 @@ Y_UNIT_TEST_SUITE(Replication) UNIT_ASSERT_C(sessionResult.IsSuccess(), sessionResult.GetIssues().ToString()); auto s = sessionResult.GetSession(); + TUuidValue expectedKey2("5b99a330-04ef-4f1a-9b64-ba6d5f44ea00"); TUuidValue expectedV1("5b99a330-04ef-4f1a-9b64-ba6d5f44ea01"); TUuidValue expectedV2("5b99a330-04ef-4f1a-9b64-ba6d5f44ea02"); double expectedV3 = 311111111113.222222223; @@ -97,11 +100,13 @@ Y_UNIT_TEST_SUITE(Replication) if (res.first == 1) { const Ydb::ResultSet& proto = res.second; UNIT_ASSERT_VALUES_EQUAL(proto.rows(0).items(0).uint32_value(), 1); - UNIT_ASSERT_VALUES_EQUAL(proto.rows(0).items(1).low_128(), expectedV1.Buf_.Halfs[0]); - UNIT_ASSERT_VALUES_EQUAL(proto.rows(0).items(1).high_128(), expectedV1.Buf_.Halfs[1]); - UNIT_ASSERT_VALUES_EQUAL(proto.rows(0).items(2).low_128(), expectedV2.Buf_.Halfs[0]); - UNIT_ASSERT_VALUES_EQUAL(proto.rows(0).items(2).high_128(), expectedV2.Buf_.Halfs[1]); - UNIT_ASSERT_DOUBLES_EQUAL(proto.rows(0).items(3).double_value(), expectedV3, 0.0001); + UNIT_ASSERT_VALUES_EQUAL(proto.rows(0).items(1).low_128(), expectedKey2.Buf_.Halfs[0]); + UNIT_ASSERT_VALUES_EQUAL(proto.rows(0).items(1).high_128(), expectedKey2.Buf_.Halfs[1]); + UNIT_ASSERT_VALUES_EQUAL(proto.rows(0).items(2).low_128(), expectedV1.Buf_.Halfs[0]); + UNIT_ASSERT_VALUES_EQUAL(proto.rows(0).items(2).high_128(), expectedV1.Buf_.Halfs[1]); + UNIT_ASSERT_VALUES_EQUAL(proto.rows(0).items(3).low_128(), expectedV2.Buf_.Halfs[0]); + UNIT_ASSERT_VALUES_EQUAL(proto.rows(0).items(3).high_128(), expectedV2.Buf_.Halfs[1]); + UNIT_ASSERT_DOUBLES_EQUAL(proto.rows(0).items(4).double_value(), expectedV3, 0.0001); break; } Sleep(TDuration::Seconds(1));