Skip to content

Commit 943d232

Browse files
authored
Merge 875d5b3 into c7123e3
2 parents c7123e3 + 875d5b3 commit 943d232

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

ydb/core/kqp/ut/olap/kqp_olap_ut.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,6 +2622,41 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
26222622

26232623
}
26242624

2625+
Y_UNIT_TEST(MultiInsertWithSinks) {
2626+
NKikimrConfig::TAppConfig appConfig;
2627+
appConfig.MutableTableServiceConfig()->SetEnableOlapSink(true);
2628+
auto settings = TKikimrSettings()
2629+
.SetAppConfig(appConfig)
2630+
.SetWithSampleTables(false);
2631+
TKikimrRunner kikimr(settings);
2632+
2633+
TLocalHelper(kikimr).CreateTestOlapTable();
2634+
2635+
auto db = kikimr.GetQueryClient();
2636+
2637+
auto result = db.ExecuteQuery(R"(
2638+
INSERT INTO `/Root/olapStore/olapTable` (timestamp, uid, resource_id) VALUES (Timestamp('1970-01-01T00:00:00Z'), 'a', '0');
2639+
INSERT INTO `/Root/olapStore/olapTable` (timestamp, uid, resource_id) VALUES (Timestamp('1970-01-01T00:00:01Z'), 'b', 't');
2640+
INSERT INTO `/Root/olapStore/olapTable` (timestamp, uid, resource_id) VALUES (Timestamp('1970-01-01T00:00:02Z'), 'c', 'test');
2641+
)", NYdb::NQuery::TTxControl::BeginTx().CommitTx()).ExtractValueSync();
2642+
2643+
UNIT_ASSERT_C(result.IsSuccess(), result.GetIssues().ToString());
2644+
2645+
{
2646+
auto it = db.StreamExecuteQuery(R"(
2647+
--!syntax_v1
2648+
2649+
SELECT
2650+
*
2651+
FROM `/Root/olapStore/olapTable` ORDER BY uid
2652+
)", NYdb::NQuery::TTxControl::BeginTx().CommitTx()).GetValueSync();
2653+
2654+
UNIT_ASSERT_C(it.IsSuccess(), it.GetIssues().ToString());
2655+
TString result = StreamResultToYson(it);
2656+
CompareYson(result, R"([[#;#;["0"];0u;"a"];[#;#;["t"];1000000u;"b"];[#;#;["test"];2000000u;"c"]])");
2657+
}
2658+
}
2659+
26252660
}
26262661

26272662
}

ydb/library/yql/dq/type_ann/dq_type_ann.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ TStatus AnnotateStage(const TExprNode::TPtr& stage, TExprContext& ctx) {
273273
for (auto sink : sinks) {
274274
sink->SetTypeAnn(resultType);
275275
}
276+
stage->Child(TDqStageBase::idx_Outputs)->SetTypeAnn(stage->Child(TDqStageBase::idx_Outputs)->GetTypeAnn());
276277
stageResultTypes.assign(programResultTypesTuple.begin(), programResultTypesTuple.end());
277278
} else {
278279
for (auto transform : transforms) {

0 commit comments

Comments
 (0)