summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPisarenko Grigoriy <[email protected]>2026-07-28 00:14:13 +0500
committerGitHub <[email protected]>2026-07-27 22:14:13 +0300
commit377b18d18ac2f75d48de147c047d9764ed421d07 (patch)
treeab46d16b1fbddef600bd4c8ed53cd725fc43a45e
parent947e961ca04e7b552feffe0ad109835d5fb3aa5f (diff)
YQ-5406 added unit test on parallel precompute (#48014)HEADmain
-rw-r--r--ydb/core/kqp/ut/federated_query/datastreams/streaming_ddl_ut.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/ydb/core/kqp/ut/federated_query/datastreams/streaming_ddl_ut.cpp b/ydb/core/kqp/ut/federated_query/datastreams/streaming_ddl_ut.cpp
index b512a370adb..5aae3622524 100644
--- a/ydb/core/kqp/ut/federated_query/datastreams/streaming_ddl_ut.cpp
+++ b/ydb/core/kqp/ut/federated_query/datastreams/streaming_ddl_ut.cpp
@@ -1366,10 +1366,12 @@ Y_UNIT_TEST_SUITE(KqpStreamingQueriesDdl) {
}
Y_UNIT_TEST_F(StreamingQueryWithPrecompute, TStreamingTestFixture) {
+ ExecQuery("GRANT ALL ON `/Root` TO `" BUILTIN_ACL_ROOT "`");
+
constexpr char inputTopicName[] = "streamingQueryWithPrecomputeInputTopic";
constexpr char outputTopicName[] = "streamingQueryWithPrecomputeOutputTopic";
constexpr char pqSourceName[] = "pqSourceName";
- CreateTopic(inputTopicName);
+ CreateTopic(inputTopicName, NTopic::TCreateTopicSettings().PartitioningSettings(2, 2));
CreateTopic(outputTopicName);
CreatePqSource(pqSourceName);
@@ -1415,6 +1417,25 @@ Y_UNIT_TEST_SUITE(KqpStreamingQueriesDdl) {
ReadTopicMessage(outputTopicName, "message-1-value-1");
Sleep(TDuration::Seconds(1)); // wait for checkpoint commit
+ const auto& result = ExecQuery("SELECT Plan, Ast FROM `.sys/streaming_queries`");
+ UNIT_ASSERT_VALUES_EQUAL(result.size(), 1);
+ CheckScriptResult(result[0], 2, 1, [&](TResultSetParser& resultSet) {
+ AstChecker(2, 3)(resultSet.ColumnParser("Ast").GetOptionalUtf8().value_or(""));
+
+ const auto planJson = resultSet.ColumnParser("Plan").GetOptionalUtf8().value_or("");
+ Cerr << "Plan: " << planJson << Endl;
+ NJson::TJsonValue plan;
+ UNIT_ASSERT(NJson::ReadJsonTree(planJson, &plan));
+
+ const auto& stagePlan = plan["Plan"]["Plans"][0]["Plans"][0];
+ UNIT_ASSERT_VALUES_EQUAL(stagePlan["Node Type"].GetStringSafe(), "Stage");
+ UNIT_ASSERT_VALUES_EQUAL(stagePlan["Stats"]["Tasks"].GetIntegerSafe(), 2);
+
+ const auto& sourceOp = stagePlan["Plans"][0]["Operators"].GetArraySafe()[0];
+ UNIT_ASSERT_VALUES_EQUAL(sourceOp["ExternalDataSource"].GetStringSafe(), pqSourceName);
+ UNIT_ASSERT_VALUES_EQUAL(sourceOp["SourceType"].GetStringSafe(), "pq");
+ });
+
ExecQuery(fmt::format(R"(
ALTER STREAMING QUERY `{query_name}` SET (
RUN = FALSE