@@ -2706,7 +2706,6 @@ Y_UNIT_TEST_SUITE(DataStreams) {
2706
2706
2707
2707
TString streamName = " test-topic" ;
2708
2708
TString streamName2 = " test-topic-2" ;
2709
-
2710
2709
{
2711
2710
NYdb::NTopic::TTopicClient pqClient (*testServer.Driver );
2712
2711
auto settings = NYdb::NTopic::TCreateTopicSettings ()
@@ -2807,6 +2806,67 @@ Y_UNIT_TEST_SUITE(DataStreams) {
2807
2806
UNIT_ASSERT_VALUES_EQUAL (description.shards (4 ).parent_shard_id (), " shard-000001" );
2808
2807
}
2809
2808
2809
+ auto streamForAlterTest = " stream-alter-test" ;
2810
+ {
2811
+ auto result = testServer.DataStreamsClient ->CreateStream (streamForAlterTest,
2812
+ NYDS_V1::TCreateStreamSettings ()
2813
+ .ShardCount (3 )
2814
+ ).ExtractValueSync ();
2815
+ UNIT_ASSERT_VALUES_EQUAL (result.IsTransportError (), false );
2816
+ if (result.GetStatus () != EStatus::SUCCESS) {
2817
+ result.GetIssues ().PrintTo (Cerr);
2818
+ }
2819
+ UNIT_ASSERT_VALUES_EQUAL_C (result.GetStatus (), EStatus::SUCCESS, result.GetIssues ().ToString ());
2820
+ }
2821
+
2822
+ {
2823
+ auto result = testServer.DataStreamsClient ->DescribeStream (streamForAlterTest).ExtractValueSync ();
2824
+ UNIT_ASSERT_VALUES_EQUAL (result.IsTransportError (), false );
2825
+ Cerr << result.GetIssues ().ToString () << " \n " ;
2826
+ UNIT_ASSERT_VALUES_EQUAL_C (result.GetStatus (), EStatus::SUCCESS, result.GetIssues ().ToString ());
2827
+
2828
+ auto & d = result.GetResult ().stream_description ();
2829
+ UNIT_ASSERT_VALUES_EQUAL (d.shards ().size (), 3 );
2830
+ UNIT_ASSERT_VALUES_EQUAL (d.stream_status (), YDS_V1::StreamDescription::ACTIVE);
2831
+ UNIT_ASSERT_VALUES_EQUAL (d.stream_name (), streamForAlterTest);
2832
+ UNIT_ASSERT_VALUES_EQUAL (d.stream_arn (), streamForAlterTest);
2833
+
2834
+ UNIT_ASSERT_VALUES_EQUAL (d.partitioning_settings ().auto_partitioning_settings ().strategy (), ::Ydb::DataStreams::V1::AutoPartitioningStrategy::AUTO_PARTITIONING_STRATEGY_DISABLED);
2835
+ }
2836
+
2837
+ {
2838
+ auto result = testServer.DataStreamsClient ->UpdateStream (streamForAlterTest,
2839
+ NYDS_V1::TUpdateStreamSettings ()
2840
+ .TargetShardCount (5 )
2841
+ .BeginConfigurePartitioningSettings ()
2842
+ .BeginConfigureAutoPartitioningSettings ()
2843
+ .Strategy (NYdb::NDataStreams::V1::EAutoPartitioningStrategy::Disabled)
2844
+ .EndConfigureAutoPartitioningSettings ()
2845
+ .EndConfigurePartitioningSettings ()
2846
+ ).ExtractValueSync ();
2847
+
2848
+ UNIT_ASSERT_VALUES_EQUAL (result.IsTransportError (), false );
2849
+ if (result.GetStatus () != EStatus::SUCCESS) {
2850
+ result.GetIssues ().PrintTo (Cerr);
2851
+ }
2852
+ UNIT_ASSERT_VALUES_EQUAL_C (result.GetStatus (), EStatus::SUCCESS, result.GetIssues ().ToString ());
2853
+ }
2854
+
2855
+ {
2856
+ auto result = testServer.DataStreamsClient ->DescribeStream (streamForAlterTest).ExtractValueSync ();
2857
+ UNIT_ASSERT_VALUES_EQUAL (result.IsTransportError (), false );
2858
+ Cerr << result.GetIssues ().ToString () << " \n " ;
2859
+ UNIT_ASSERT_VALUES_EQUAL_C (result.GetStatus (), EStatus::SUCCESS, result.GetIssues ().ToString ());
2860
+
2861
+ auto & d = result.GetResult ().stream_description ();
2862
+ UNIT_ASSERT_VALUES_EQUAL (d.shards ().size (), 5 );
2863
+ UNIT_ASSERT_VALUES_EQUAL (d.stream_status (), YDS_V1::StreamDescription::ACTIVE);
2864
+ UNIT_ASSERT_VALUES_EQUAL (d.stream_name (), streamForAlterTest);
2865
+ UNIT_ASSERT_VALUES_EQUAL (d.stream_arn (), streamForAlterTest);
2866
+
2867
+ UNIT_ASSERT_VALUES_EQUAL (d.partitioning_settings ().auto_partitioning_settings ().strategy (), ::Ydb::DataStreams::V1::AutoPartitioningStrategy::AUTO_PARTITIONING_STRATEGY_DISABLED);
2868
+ }
2869
+
2810
2870
{
2811
2871
auto result = testServer.DataStreamsClient ->CreateStream (streamName2,
2812
2872
NYDS_V1::TCreateStreamSettings ()
0 commit comments