Skip to content

Commit 47b767b

Browse files
authored
Fix multi sink type annotation (#6105)
1 parent b6e9c7d commit 47b767b

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
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
@@ -2623,6 +2623,41 @@ Y_UNIT_TEST_SUITE(KqpOlap) {
26232623

26242624
}
26252625

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

26282663
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,6 @@ TStatus AnnotateStage(const TExprNode::TPtr& stage, TExprContext& ctx) {
270270
}
271271

272272
if (!sinks.empty()) {
273-
for (auto sink : sinks) {
274-
sink->SetTypeAnn(resultType);
275-
}
276273
stageResultTypes.assign(programResultTypesTuple.begin(), programResultTypesTuple.end());
277274
} else {
278275
for (auto transform : transforms) {

0 commit comments

Comments
 (0)