@@ -3126,7 +3126,7 @@ Y_UNIT_TEST_SUITE(KqpQueryService) {
3126
3126
)" , NYdb::NQuery::TTxControl::BeginTx ().CommitTx ()).ExtractValueSync ();
3127
3127
UNIT_ASSERT_C (result.IsSuccess (), result.GetIssues ().ToString ());
3128
3128
}
3129
-
3129
+
3130
3130
{
3131
3131
auto result = client.ExecuteQuery (R"(
3132
3132
SELECT COUNT(*) FROM `/Root/DataShard` WHERE Col3 = 1;
@@ -4560,6 +4560,7 @@ Y_UNIT_TEST_SUITE(KqpQueryService) {
4560
4560
CheckDirEntry (kikimr, entriesToCheck);
4561
4561
}
4562
4562
}
4563
+
4563
4564
Y_UNIT_TEST (CreateOrDropTopicOverTable) {
4564
4565
NKikimrConfig::TAppConfig appConfig;
4565
4566
appConfig.MutableTableServiceConfig ()->SetEnablePreparedDdl (true );
@@ -4631,6 +4632,65 @@ Y_UNIT_TEST_SUITE(KqpQueryService) {
4631
4632
}
4632
4633
}
4633
4634
4635
+ Y_UNIT_TEST (AlterCdcTopic) {
4636
+ NKikimrConfig::TAppConfig appConfig;
4637
+ appConfig.MutableTableServiceConfig ()->SetEnablePreparedDdl (true );
4638
+ auto setting = NKikimrKqp::TKqpSetting ();
4639
+ auto serverSettings = TKikimrSettings ()
4640
+ .SetAppConfig (appConfig)
4641
+ .SetKqpSettings ({setting});
4642
+ TKikimrRunner kikimr{serverSettings};
4643
+ auto tableClient = kikimr.GetTableClient ();
4644
+
4645
+ {
4646
+ auto tcSession = tableClient.CreateSession ().GetValueSync ().GetSession ();
4647
+ UNIT_ASSERT (tcSession.ExecuteSchemeQuery (R"(
4648
+ CREATE TABLE `/Root/TmpTable` (
4649
+ Key Uint64,
4650
+ Value String,
4651
+ PRIMARY KEY (Key)
4652
+ );
4653
+ )" ).GetValueSync ().IsSuccess ());
4654
+
4655
+ UNIT_ASSERT (tcSession.ExecuteSchemeQuery (R"(
4656
+ ALTER TABLE `/Root/TmpTable` ADD CHANGEFEED `feed` WITH (
4657
+ MODE = 'KEYS_ONLY', FORMAT = 'JSON'
4658
+ );
4659
+ )" ).GetValueSync ().IsSuccess ());
4660
+ tcSession.Close ();
4661
+ }
4662
+
4663
+ auto pq = NYdb::NTopic::TTopicClient (kikimr.GetDriver (),
4664
+ NYdb::NTopic::TTopicClientSettings ().Database (" /Root" ).AuthToken (" root@builtin" ));
4665
+
4666
+ auto client = kikimr.GetQueryClient (NYdb::NQuery::TClientSettings{}.AuthToken (" root@builtin" ));
4667
+ auto session = client.GetSession ().GetValueSync ().GetSession ();
4668
+ {
4669
+
4670
+ const auto query = Q_ (R"(
4671
+ --!syntax_v1
4672
+ ALTER TOPIC `/Root/TmpTable/feed` ADD CONSUMER consumer21;
4673
+ )" );
4674
+
4675
+ RunQuery (query, session);
4676
+ auto desc = pq.DescribeTopic (" /Root/TmpTable/feed" ).ExtractValueSync ();
4677
+ const auto & consumers = desc.GetTopicDescription ().GetConsumers ();
4678
+ UNIT_ASSERT_VALUES_EQUAL (consumers.size (), 1 );
4679
+ UNIT_ASSERT_VALUES_EQUAL (consumers[0 ].GetConsumerName (), " consumer21" );
4680
+
4681
+ }
4682
+ {
4683
+ const auto query = Q_ (R"(
4684
+ --!syntax_v1
4685
+ ALTER TOPIC `/Root/TmpTable/feed` SET (min_active_partitions = 10);
4686
+ )" );
4687
+ RunQuery (query, session, false );
4688
+ auto desc = pq.DescribeTopic (" /Root/TmpTable/feed" ).ExtractValueSync ();
4689
+ UNIT_ASSERT_VALUES_EQUAL (desc.GetTopicDescription ().GetPartitioningSettings ().GetMinActivePartitions (), 1 );
4690
+ }
4691
+
4692
+ }
4693
+
4634
4694
Y_UNIT_TEST (TableSink_OlapRWQueries) {
4635
4695
NKikimrConfig::TAppConfig appConfig;
4636
4696
appConfig.MutableTableServiceConfig ()->SetEnableOlapSink (true );
@@ -4737,7 +4797,7 @@ Y_UNIT_TEST_SUITE(KqpQueryService) {
4737
4797
auto it = client.StreamExecuteQuery (R"sql(
4738
4798
SELECT r.Col3
4739
4799
FROM `/Root/DataShard` AS r
4740
- JOIN `/Root/ColumnShard` AS c
4800
+ JOIN `/Root/ColumnShard` AS c
4741
4801
ON r.Col1 = c.Col1;
4742
4802
)sql" , NYdb::NQuery::TTxControl::BeginTx ().CommitTx ()).ExtractValueSync ();
4743
4803
UNIT_ASSERT_VALUES_EQUAL_C (it.GetStatus (), EStatus::SUCCESS, it.GetIssues ().ToString ());
0 commit comments