@@ -202,11 +202,11 @@ Y_UNIT_TEST_SUITE(KqpOlapWrite) {
202202 TTypedLocalHelper helper (" Utf8" , kikimr);
203203 helper.CreateTestOlapTable ();
204204 auto writeSession = helper.StartWriting (" /Root/olapStore/olapTable" );
205- writeSession.FillTable (NArrow::NConstruction::TStringPoolFiller (1 , 1 , " aaa" , 1 ), 0 , 800000 );
205+ writeSession.FillTable (" field " , NArrow::NConstruction::TStringPoolFiller (1 , 1 , " aaa" , 1 ), 0 , 800000 );
206206 Sleep (TDuration::Seconds (1 ));
207- writeSession.FillTable (NArrow::NConstruction::TStringPoolFiller (1 , 1 , " bbb" , 1 ), 0.5 , 800000 );
207+ writeSession.FillTable (" field " , NArrow::NConstruction::TStringPoolFiller (1 , 1 , " bbb" , 1 ), 0.5 , 800000 );
208208 Sleep (TDuration::Seconds (1 ));
209- writeSession.FillTable (NArrow::NConstruction::TStringPoolFiller (1 , 1 , " ccc" , 1 ), 0.75 , 800000 );
209+ writeSession.FillTable (" field " , NArrow::NConstruction::TStringPoolFiller (1 , 1 , " ccc" , 1 ), 0.75 , 800000 );
210210 Sleep (TDuration::Seconds (1 ));
211211 writeSession.Finalize ();
212212
@@ -228,6 +228,40 @@ Y_UNIT_TEST_SUITE(KqpOlapWrite) {
228228 UNIT_ASSERT_VALUES_EQUAL (GetUtf8 (rows[2 ].at (" field" )), " ccc" );
229229 }
230230
231+ Y_UNIT_TEST (MultiWriteInTimeDiffSchemas) {
232+ auto settings = TKikimrSettings ().SetWithSampleTables (false );
233+ settings.AppConfig .MutableColumnShardConfig ()->SetWritingBufferDurationMs (15000 );
234+ TKikimrRunner kikimr (settings);
235+ Tests::NCommon::TLoggerInit (kikimr).Initialize ();
236+ TTypedLocalHelper helper (" Utf8" , " Utf8" , kikimr);
237+ helper.CreateTestOlapTable ();
238+ auto writeGuard = helper.StartWriting (" /Root/olapStore/olapTable" );
239+ writeGuard.FillTable (" field" , NArrow::NConstruction::TStringPoolFiller (1 , 1 , " aaa" , 1 ), 0 , 800000 );
240+ Sleep (TDuration::Seconds (1 ));
241+ writeGuard.FillTable (" field1" , NArrow::NConstruction::TStringPoolFiller (1 , 1 , " bbb" , 1 ), 0.5 , 800000 );
242+ Sleep (TDuration::Seconds (1 ));
243+ writeGuard.FillTable (" field" , NArrow::NConstruction::TStringPoolFiller (1 , 1 , " ccc" , 1 ), 0.75 , 800000 );
244+ Sleep (TDuration::Seconds (1 ));
245+ writeGuard.Finalize ();
246+
247+ auto selectQuery = TString (R"(
248+ SELECT
249+ field, count(*) as count,
250+ FROM `/Root/olapStore/olapTable`
251+ GROUP BY field
252+ ORDER BY field
253+ )" );
254+
255+ auto tableClient = kikimr.GetTableClient ();
256+ auto rows = ExecuteScanQuery (tableClient, selectQuery);
257+ UNIT_ASSERT_VALUES_EQUAL (GetUint64 (rows[0 ].at (" count" )), 200000 );
258+ UNIT_ASSERT_VALUES_EQUAL (GetUtf8 (rows[0 ].at (" field" )), " " );
259+ UNIT_ASSERT_VALUES_EQUAL (GetUint64 (rows[1 ].at (" count" )), 400000 );
260+ UNIT_ASSERT_VALUES_EQUAL (GetUtf8 (rows[1 ].at (" field" )), " aaa" );
261+ UNIT_ASSERT_VALUES_EQUAL (GetUint64 (rows[2 ].at (" count" )), 800000 );
262+ UNIT_ASSERT_VALUES_EQUAL (GetUtf8 (rows[2 ].at (" field" )), " ccc" );
263+ }
264+
231265 Y_UNIT_TEST (WriteDeleteCleanGC) {
232266 auto csController = NKikimr::NYDBTest::TControllers::RegisterCSControllerGuard<NKikimr::NOlap::TWaitCompactionController>();
233267 csController->SetSmallSizeDetector (1000000 );
0 commit comments