From b85b56cb8fc0e80c9624d40ff6f400a25c6cccd1 Mon Sep 17 00:00:00 2001 From: Grigoriy Pisarenko Date: Sat, 22 Jun 2024 14:14:10 +0000 Subject: [PATCH 1/6] Added oltp sink into kqprun --- ydb/tests/tools/kqprun/configuration/app_config.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/ydb/tests/tools/kqprun/configuration/app_config.conf b/ydb/tests/tools/kqprun/configuration/app_config.conf index eebc7479f333..13954ed21309 100644 --- a/ydb/tests/tools/kqprun/configuration/app_config.conf +++ b/ydb/tests/tools/kqprun/configuration/app_config.conf @@ -117,6 +117,7 @@ TableServiceConfig { CompileTimeoutMs: 600000 EnableCreateTableAs: true EnableOlapSink: true + EnableOltpSink: true EnablePerStatementQueryExecution: true SessionsLimitPerNode: 1000 From d1cd88b08472bf51bb0e4d2c9be91f92f8322b7f Mon Sep 17 00:00:00 2001 From: Grigoriy Pisarenko Date: Mon, 1 Jul 2024 13:30:13 +0000 Subject: [PATCH 2/6] Added EnableTempTables flag into kqprun config --- ydb/tests/tools/kqprun/configuration/app_config.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/ydb/tests/tools/kqprun/configuration/app_config.conf b/ydb/tests/tools/kqprun/configuration/app_config.conf index 13954ed21309..0401019bdfc5 100644 --- a/ydb/tests/tools/kqprun/configuration/app_config.conf +++ b/ydb/tests/tools/kqprun/configuration/app_config.conf @@ -3,6 +3,7 @@ FeatureFlags { EnableScriptExecutionOperations: true EnableExternalSourceSchemaInference: true EnableResourcePools: true + EnableTempTables: true } KQPConfig { From f1bf5c599625f0e7856c5c9bff60949d14549289 Mon Sep 17 00:00:00 2001 From: Grigoriy Pisarenko Date: Tue, 2 Jul 2024 08:00:41 +0000 Subject: [PATCH 3/6] Fixed CTAS for s3 sources --- ydb/core/kqp/host/kqp_statement_rewrite.cpp | 2 +- .../kqp/ut/federated_query/common/common.cpp | 3 +- .../s3/kqp_federated_query_ut.cpp | 165 ++++++++++++++++++ ydb/core/testlib/basics/feature_flags.h | 1 + ydb/tests/tools/kqprun/kqprun.cpp | 48 +++-- 5 files changed, 204 insertions(+), 15 deletions(-) diff --git a/ydb/core/kqp/host/kqp_statement_rewrite.cpp b/ydb/core/kqp/host/kqp_statement_rewrite.cpp index 1ef5694021ee..4e9b7ddff487 100644 --- a/ydb/core/kqp/host/kqp_statement_rewrite.cpp +++ b/ydb/core/kqp/host/kqp_statement_rewrite.cpp @@ -189,7 +189,7 @@ namespace { : (TStringBuilder() << "/Root/.tmp/sessions/" << sessionCtx->GetSessionId() - << tmpTableName); + << CanonizePath(tmpTableName)); create = exprCtx.ReplaceNode(std::move(create), *columns, exprCtx.NewList(pos, std::move(columnNodes))); diff --git a/ydb/core/kqp/ut/federated_query/common/common.cpp b/ydb/core/kqp/ut/federated_query/common/common.cpp index 6b0f2002cea3..7db91270e9a9 100644 --- a/ydb/core/kqp/ut/federated_query/common/common.cpp +++ b/ydb/core/kqp/ut/federated_query/common/common.cpp @@ -53,7 +53,8 @@ namespace NKikimr::NKqp::NFederatedQueryTest { .SetFeatureFlags(featureFlags) .SetFederatedQuerySetupFactory(federatedQuerySetupFactory) .SetKqpSettings({}) - .SetS3ActorsFactory(std::move(s3ActorsFactory)); + .SetS3ActorsFactory(std::move(s3ActorsFactory)) + .SetWithSampleTables(false); settings = settings.SetAppConfig(appConfig.value()); diff --git a/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp b/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp index 0dd70339a5c9..c43e4602d8d0 100644 --- a/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp +++ b/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp @@ -1792,6 +1792,171 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) { Y_UNIT_TEST(ExecuteScriptWithThinFile) { ExecuteSelectQuery("test_bucket_execute_script_with_large_file", 5_MB, 500000); } + + std::shared_ptr CreateSampleDataSource(const TString& externalDataSourceName, const TString& externalTableName) { + const TString bucket = "test_bucket3"; + const TString object = "test_object"; + + NKikimrConfig::TAppConfig appConfig; + appConfig.MutableTableServiceConfig()->SetEnableOlapSink(true); + appConfig.MutableTableServiceConfig()->SetEnableOltpSink(true); + appConfig.MutableTableServiceConfig()->SetEnableCreateTableAs(true); + appConfig.MutableTableServiceConfig()->SetEnablePerStatementQueryExecution(true); + appConfig.MutableFeatureFlags()->SetEnableTempTables(true); + auto kikimr = NTestUtils::MakeKikimrRunner(appConfig); + + CreateBucketWithObject(bucket, "test_object", TEST_CONTENT); + + auto tc = kikimr->GetTableClient(); + auto session = tc.CreateSession().GetValueSync().GetSession(); + const TString query = fmt::format(R"( + CREATE EXTERNAL DATA SOURCE `{external_source}` WITH ( + SOURCE_TYPE="ObjectStorage", + LOCATION="{location}", + AUTH_METHOD="NONE" + ); + CREATE EXTERNAL TABLE `{external_table}` ( + key Utf8 NOT NULL, + value Utf8 NOT NULL + ) WITH ( + DATA_SOURCE="{external_source}", + LOCATION="{object}", + FORMAT="json_each_row" + );)", + "external_source"_a = externalDataSourceName, + "external_table"_a = externalTableName, + "location"_a = GetBucketLocation(bucket), + "object"_a = object + ); + auto result = session.ExecuteSchemeQuery(query).GetValueSync(); + UNIT_ASSERT_C(result.GetStatus() == NYdb::EStatus::SUCCESS, result.GetIssues().ToString()); + + return kikimr; + } + + void ValidateResult(const TExecuteQueryResult& result) { + UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); + UNIT_ASSERT_VALUES_EQUAL_C(result.GetResultSets().size(), 1, "Unexpected result sets count"); + + TResultSetParser resultSet(result.GetResultSet(0)); + UNIT_ASSERT_VALUES_EQUAL(resultSet.ColumnsCount(), 2); + UNIT_ASSERT_VALUES_EQUAL(resultSet.RowsCount(), 2); + + UNIT_ASSERT(resultSet.TryNextRow()); + UNIT_ASSERT_VALUES_EQUAL(resultSet.ColumnParser(0).GetUtf8(), "1"); + UNIT_ASSERT_VALUES_EQUAL(resultSet.ColumnParser(1).GetUtf8(), "trololo"); + + UNIT_ASSERT(resultSet.TryNextRow()); + UNIT_ASSERT_VALUES_EQUAL(resultSet.ColumnParser(0).GetUtf8(), "2"); + UNIT_ASSERT_VALUES_EQUAL(resultSet.ColumnParser(1).GetUtf8(), "hello world"); + + } + + void ValidateTables(TQueryClient& client, const TString& oltpTable, const TString& olapTable) { + { + const TString query = TStringBuilder() << "SELECT Unwrap(key), Unwrap(value) FROM `" << oltpTable << "`;"; + ValidateResult(client.ExecuteQuery(query, NYdb::NQuery::TTxControl::BeginTx().CommitTx()).ExtractValueSync()); + } + + { + const TString query = TStringBuilder() << "SELECT key, value FROM `" << olapTable << "` ORDER BY key;"; + ValidateResult(client.ExecuteQuery(query, NYdb::NQuery::TTxControl::BeginTx().CommitTx()).ExtractValueSync()); + } + } + + Y_UNIT_TEST(CreateTableAsSelectFromExternalDataSource) { + const TString externalDataSourceName = "/Root/external_data_source"; + const TString externalTableName = "/Root/test_binding_resolve"; + + auto kikimr = CreateSampleDataSource(externalDataSourceName, externalTableName); + auto client = kikimr->GetQueryClient(); + + const TString oltpTable = "/Root/DestinationOltp"; + { + const TString query = fmt::format(R"( + CREATE TABLE `{destination}` ( + PRIMARY KEY (key, value) + ) + AS SELECT * + FROM `{external_source}`.`/` WITH ( + format="json_each_row", + schema( + key Utf8 NOT NULL, + value Utf8 NOT NULL + ) + );)", + "destination"_a = oltpTable, + "external_source"_a = externalDataSourceName + ); + auto result = client.ExecuteQuery(query, NYdb::NQuery::TTxControl::NoTx()).ExtractValueSync(); + UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); + } + + const TString olapTable = "/Root/DestinationOlap"; + { + const TString query = fmt::format(R"( + CREATE TABLE `{destination}` ( + PRIMARY KEY (key, value) + ) + WITH (STORE = COLUMN) + AS SELECT * + FROM `{external_source}`.`/` WITH ( + format="json_each_row", + schema( + key Utf8 NOT NULL, + value Utf8 NOT NULL + ) + );)", + "destination"_a = olapTable, + "external_source"_a = externalDataSourceName + ); + auto result = client.ExecuteQuery(query, NYdb::NQuery::TTxControl::NoTx()).ExtractValueSync(); + UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); + } + + ValidateTables(client, oltpTable, olapTable); + } + + Y_UNIT_TEST(CreateTableAsSelectFromExternalTable) { + const TString externalDataSourceName = "/Root/external_data_source"; + const TString externalTableName = "/Root/test_binding_resolve"; + + auto kikimr = CreateSampleDataSource(externalDataSourceName, externalTableName); + auto client = kikimr->GetQueryClient(); + + const TString oltpTable = "/Root/DestinationOltp"; + { + const TString query = fmt::format(R"( + CREATE TABLE `{destination}` ( + PRIMARY KEY (key, value) + ) + AS SELECT * + FROM `{external_table}`;)", + "destination"_a = oltpTable, + "external_table"_a = externalTableName + ); + auto result = client.ExecuteQuery(query, NYdb::NQuery::TTxControl::NoTx()).ExtractValueSync(); + UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); + } + + const TString olapTable = "/Root/DestinationOlap"; + { + const TString query = fmt::format(R"( + CREATE TABLE `{destination}` ( + PRIMARY KEY (key, value) + ) + WITH (STORE = COLUMN) + AS SELECT * + FROM `{external_table}`;)", + "destination"_a = olapTable, + "external_table"_a = externalTableName + ); + auto result = client.ExecuteQuery(query, NYdb::NQuery::TTxControl::NoTx()).ExtractValueSync(); + UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); + } + + ValidateTables(client, oltpTable, olapTable); + } } } // namespace NKikimr::NKqp diff --git a/ydb/core/testlib/basics/feature_flags.h b/ydb/core/testlib/basics/feature_flags.h index d93dd22e033c..1270874e4a02 100644 --- a/ydb/core/testlib/basics/feature_flags.h +++ b/ydb/core/testlib/basics/feature_flags.h @@ -44,6 +44,7 @@ class TTestFeatureFlagsHolder { FEATURE_FLAG_SETTER(EnableTopicDiskSubDomainQuota) FEATURE_FLAG_SETTER(EnablePQConfigTransactionsAtSchemeShard) FEATURE_FLAG_SETTER(EnableScriptExecutionOperations) + FEATURE_FLAG_SETTER(EnableExternalDataSources) FEATURE_FLAG_SETTER(EnableForceImmediateEffectsExecution) FEATURE_FLAG_SETTER(EnableTopicSplitMerge) FEATURE_FLAG_SETTER(EnableTempTables) diff --git a/ydb/tests/tools/kqprun/kqprun.cpp b/ydb/tests/tools/kqprun/kqprun.cpp index 3386bee075c8..c5a80cda33b9 100644 --- a/ydb/tests/tools/kqprun/kqprun.cpp +++ b/ydb/tests/tools/kqprun/kqprun.cpp @@ -60,12 +60,9 @@ struct TExecutionOptions { }; -void RunScript(const TExecutionOptions& executionOptions, const NKqpRun::TRunnerOptions& runnerOptions) { +void RunArgumentQueries(const TExecutionOptions& executionOptions, NKqpRun::TKqpRunner& runner) { NColorizer::TColors colors = NColorizer::AutoColors(Cout); - Cout << colors.Yellow() << TInstant::Now().ToIsoStringLocal() << " Initialization of kqp runner..." << colors.Default() << Endl; - NKqpRun::TKqpRunner runner(runnerOptions); - if (executionOptions.SchemeQuery) { Cout << colors.Yellow() << TInstant::Now().ToIsoStringLocal() << " Executing scheme query..." << colors.Default() << Endl; if (!runner.ExecuteSchemeQuery(executionOptions.SchemeQuery, executionOptions.TraceId)) { @@ -136,20 +133,45 @@ void RunScript(const TExecutionOptions& executionOptions, const NKqpRun::TRunner ythrow yexception() << "Failed to print script results, reason:\n" << CurrentExceptionMessage(); } } +} - if (runnerOptions.YdbSettings.MonitoringEnabled) { - Cout << colors.Yellow() << TInstant::Now().ToIsoStringLocal() << " Started reading commands" << colors.Default() << Endl; - while (true) { - TString command; - Cin >> command; - if (command == "exit") { - break; - } - Cerr << colors.Red() << TInstant::Now().ToIsoStringLocal() << " Invalid command '" << command << "'" << colors.Default() << Endl; +void RunAsDaemon() { + NColorizer::TColors colors = NColorizer::AutoColors(Cout); + + Cout << colors.Yellow() << TInstant::Now().ToIsoStringLocal() << " Started reading commands" << colors.Default() << Endl; + while (true) { + TString command; + Cin >> command; + + if (command == "exit") { + break; + } + Cerr << colors.Red() << TInstant::Now().ToIsoStringLocal() << " Invalid command '" << command << "'" << colors.Default() << Endl; + } +} + + +void RunScript(const TExecutionOptions& executionOptions, const NKqpRun::TRunnerOptions& runnerOptions) { + NColorizer::TColors colors = NColorizer::AutoColors(Cout); + + Cout << colors.Yellow() << TInstant::Now().ToIsoStringLocal() << " Initialization of kqp runner..." << colors.Default() << Endl; + NKqpRun::TKqpRunner runner(runnerOptions); + + try { + RunArgumentQueries(executionOptions, runner); + } catch (const yexception& exception) { + if (runnerOptions.YdbSettings.MonitoringEnabled) { + Cerr << colors.Red() << CurrentExceptionMessage() << colors.Default() << Endl; + } else { + throw exception; } } + if (runnerOptions.YdbSettings.MonitoringEnabled) { + RunAsDaemon(); + } + Cout << colors.Yellow() << TInstant::Now().ToIsoStringLocal() << " Finalization of kqp runner..." << colors.Default() << Endl; } From b419aa571d32b330db25e6be3eae0af2b299f22b Mon Sep 17 00:00:00 2001 From: Grigoriy Pisarenko Date: Tue, 2 Jul 2024 08:03:11 +0000 Subject: [PATCH 4/6] Removed changes in app_config --- ydb/tests/tools/kqprun/configuration/app_config.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/ydb/tests/tools/kqprun/configuration/app_config.conf b/ydb/tests/tools/kqprun/configuration/app_config.conf index 0401019bdfc5..6d9a34e34146 100644 --- a/ydb/tests/tools/kqprun/configuration/app_config.conf +++ b/ydb/tests/tools/kqprun/configuration/app_config.conf @@ -2,8 +2,6 @@ FeatureFlags { EnableExternalDataSources: true EnableScriptExecutionOperations: true EnableExternalSourceSchemaInference: true - EnableResourcePools: true - EnableTempTables: true } KQPConfig { @@ -118,7 +116,6 @@ TableServiceConfig { CompileTimeoutMs: 600000 EnableCreateTableAs: true EnableOlapSink: true - EnableOltpSink: true EnablePerStatementQueryExecution: true SessionsLimitPerNode: 1000 From 741a2eb8cc759a61105f885de227208030468f96 Mon Sep 17 00:00:00 2001 From: Grigoriy Pisarenko Date: Tue, 2 Jul 2024 09:23:15 +0000 Subject: [PATCH 5/6] Fixed unit tests --- .../s3/kqp_federated_query_ut.cpp | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp b/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp index c43e4602d8d0..1af096a47d34 100644 --- a/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp +++ b/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp @@ -1865,15 +1865,16 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) { } Y_UNIT_TEST(CreateTableAsSelectFromExternalDataSource) { - const TString externalDataSourceName = "/Root/external_data_source"; - const TString externalTableName = "/Root/test_binding_resolve"; + const TString externalDataSourceName = "external_data_source"; + const TString externalTableName = "test_binding_resolve"; auto kikimr = CreateSampleDataSource(externalDataSourceName, externalTableName); auto client = kikimr->GetQueryClient(); - const TString oltpTable = "/Root/DestinationOltp"; + const TString oltpTable = "DestinationOltp"; { const TString query = fmt::format(R"( + PRAGMA TablePathPrefix = "Root"; CREATE TABLE `{destination}` ( PRIMARY KEY (key, value) ) @@ -1892,9 +1893,10 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) { UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); } - const TString olapTable = "/Root/DestinationOlap"; + const TString olapTable = "DestinationOlap"; { const TString query = fmt::format(R"( + PRAGMA TablePathPrefix = "Root"; CREATE TABLE `{destination}` ( PRIMARY KEY (key, value) ) @@ -1918,15 +1920,16 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) { } Y_UNIT_TEST(CreateTableAsSelectFromExternalTable) { - const TString externalDataSourceName = "/Root/external_data_source"; - const TString externalTableName = "/Root/test_binding_resolve"; + const TString externalDataSourceName = "external_data_source"; + const TString externalTableName = "test_binding_resolve"; auto kikimr = CreateSampleDataSource(externalDataSourceName, externalTableName); auto client = kikimr->GetQueryClient(); - const TString oltpTable = "/Root/DestinationOltp"; + const TString oltpTable = "DestinationOltp"; { const TString query = fmt::format(R"( + PRAGMA TablePathPrefix = "Root"; CREATE TABLE `{destination}` ( PRIMARY KEY (key, value) ) @@ -1939,9 +1942,10 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) { UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString()); } - const TString olapTable = "/Root/DestinationOlap"; + const TString olapTable = "DestinationOlap"; { const TString query = fmt::format(R"( + PRAGMA TablePathPrefix = "Root"; CREATE TABLE `{destination}` ( PRIMARY KEY (key, value) ) From d44920d5ee01644eb1ba33275a9c1c8a9969ed7f Mon Sep 17 00:00:00 2001 From: Grigoriy Pisarenko Date: Thu, 4 Jul 2024 08:01:45 +0000 Subject: [PATCH 6/6] Fixed domain name for temp tables --- ydb/core/kqp/host/kqp_statement_rewrite.cpp | 3 ++- ydb/core/kqp/ut/federated_query/common/common.cpp | 6 ++++-- ydb/core/kqp/ut/federated_query/common/common.h | 3 ++- .../ut/federated_query/s3/kqp_federated_query_ut.cpp | 10 +++++----- .../kqp/ut/federated_query/s3/s3_recipe_ut_helpers.cpp | 4 ++-- .../kqp/ut/federated_query/s3/s3_recipe_ut_helpers.h | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/ydb/core/kqp/host/kqp_statement_rewrite.cpp b/ydb/core/kqp/host/kqp_statement_rewrite.cpp index 4e9b7ddff487..bf15ab483261 100644 --- a/ydb/core/kqp/host/kqp_statement_rewrite.cpp +++ b/ydb/core/kqp/host/kqp_statement_rewrite.cpp @@ -187,7 +187,8 @@ namespace { const TString createTableName = !isAtomicOperation ? tableName : (TStringBuilder() - << "/Root/.tmp/sessions/" + << CanonizePath(AppData()->TenantName) + << "/.tmp/sessions/" << sessionCtx->GetSessionId() << CanonizePath(tmpTableName)); diff --git a/ydb/core/kqp/ut/federated_query/common/common.cpp b/ydb/core/kqp/ut/federated_query/common/common.cpp index 7db91270e9a9..3eedafce2684 100644 --- a/ydb/core/kqp/ut/federated_query/common/common.cpp +++ b/ydb/core/kqp/ut/federated_query/common/common.cpp @@ -21,7 +21,8 @@ namespace NKikimr::NKqp::NFederatedQueryTest { NYql::NConnector::IClient::TPtr connectorClient, NYql::IDatabaseAsyncResolver::TPtr databaseAsyncResolver, std::optional appConfig, - std::shared_ptr s3ActorsFactory) + std::shared_ptr s3ActorsFactory, + const TString& domainRoot) { NKikimrConfig::TFeatureFlags featureFlags; featureFlags.SetEnableExternalDataSources(true); @@ -54,7 +55,8 @@ namespace NKikimr::NKqp::NFederatedQueryTest { .SetFederatedQuerySetupFactory(federatedQuerySetupFactory) .SetKqpSettings({}) .SetS3ActorsFactory(std::move(s3ActorsFactory)) - .SetWithSampleTables(false); + .SetWithSampleTables(false) + .SetDomainRoot(domainRoot); settings = settings.SetAppConfig(appConfig.value()); diff --git a/ydb/core/kqp/ut/federated_query/common/common.h b/ydb/core/kqp/ut/federated_query/common/common.h index 80ce33c0bbc1..88a9d279875d 100644 --- a/ydb/core/kqp/ut/federated_query/common/common.h +++ b/ydb/core/kqp/ut/federated_query/common/common.h @@ -17,5 +17,6 @@ namespace NKikimr::NKqp::NFederatedQueryTest { NYql::NConnector::IClient::TPtr connectorClient = nullptr, NYql::IDatabaseAsyncResolver::TPtr databaseAsyncResolver = nullptr, std::optional appConfig = std::nullopt, - std::shared_ptr s3ActorsFactory = nullptr); + std::shared_ptr s3ActorsFactory = nullptr, + const TString& domainRoot = "Root"); } diff --git a/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp b/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp index 1af096a47d34..ff04ada74a18 100644 --- a/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp +++ b/ydb/core/kqp/ut/federated_query/s3/kqp_federated_query_ut.cpp @@ -1803,7 +1803,7 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) { appConfig.MutableTableServiceConfig()->SetEnableCreateTableAs(true); appConfig.MutableTableServiceConfig()->SetEnablePerStatementQueryExecution(true); appConfig.MutableFeatureFlags()->SetEnableTempTables(true); - auto kikimr = NTestUtils::MakeKikimrRunner(appConfig); + auto kikimr = NTestUtils::MakeKikimrRunner(appConfig, "TestDomain"); CreateBucketWithObject(bucket, "test_object", TEST_CONTENT); @@ -1874,7 +1874,7 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) { const TString oltpTable = "DestinationOltp"; { const TString query = fmt::format(R"( - PRAGMA TablePathPrefix = "Root"; + PRAGMA TablePathPrefix = "TestDomain"; CREATE TABLE `{destination}` ( PRIMARY KEY (key, value) ) @@ -1896,7 +1896,7 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) { const TString olapTable = "DestinationOlap"; { const TString query = fmt::format(R"( - PRAGMA TablePathPrefix = "Root"; + PRAGMA TablePathPrefix = "TestDomain"; CREATE TABLE `{destination}` ( PRIMARY KEY (key, value) ) @@ -1929,7 +1929,7 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) { const TString oltpTable = "DestinationOltp"; { const TString query = fmt::format(R"( - PRAGMA TablePathPrefix = "Root"; + PRAGMA TablePathPrefix = "TestDomain"; CREATE TABLE `{destination}` ( PRIMARY KEY (key, value) ) @@ -1945,7 +1945,7 @@ Y_UNIT_TEST_SUITE(KqpFederatedQuery) { const TString olapTable = "DestinationOlap"; { const TString query = fmt::format(R"( - PRAGMA TablePathPrefix = "Root"; + PRAGMA TablePathPrefix = "TestDomain"; CREATE TABLE `{destination}` ( PRIMARY KEY (key, value) ) diff --git a/ydb/core/kqp/ut/federated_query/s3/s3_recipe_ut_helpers.cpp b/ydb/core/kqp/ut/federated_query/s3/s3_recipe_ut_helpers.cpp index 397281a947ba..9929eb1707f3 100644 --- a/ydb/core/kqp/ut/federated_query/s3/s3_recipe_ut_helpers.cpp +++ b/ydb/core/kqp/ut/federated_query/s3/s3_recipe_ut_helpers.cpp @@ -21,8 +21,8 @@ namespace NTestUtils { extern const TString TEST_SCHEMA_IDS = R"(["StructType";[["key";["DataType";"Utf8";];];];])"; - std::shared_ptr MakeKikimrRunner(std::optional appConfig) { - return NKikimr::NKqp::NFederatedQueryTest::MakeKikimrRunner(true, nullptr, nullptr, appConfig, NYql::NDq::CreateS3ActorsFactory()); + std::shared_ptr MakeKikimrRunner(std::optional appConfig, const TString& domainRoot) { + return NKikimr::NKqp::NFederatedQueryTest::MakeKikimrRunner(true, nullptr, nullptr, appConfig, NYql::NDq::CreateS3ActorsFactory(), domainRoot); } Aws::S3::S3Client MakeS3Client() { diff --git a/ydb/core/kqp/ut/federated_query/s3/s3_recipe_ut_helpers.h b/ydb/core/kqp/ut/federated_query/s3/s3_recipe_ut_helpers.h index 8dac6d020f6e..491b888de162 100644 --- a/ydb/core/kqp/ut/federated_query/s3/s3_recipe_ut_helpers.h +++ b/ydb/core/kqp/ut/federated_query/s3/s3_recipe_ut_helpers.h @@ -29,7 +29,7 @@ namespace NTestUtils { extern const TString TEST_SCHEMA; extern const TString TEST_SCHEMA_IDS; - std::shared_ptr MakeKikimrRunner(std::optional appConfig = std::nullopt); + std::shared_ptr MakeKikimrRunner(std::optional appConfig = std::nullopt, const TString& domainRoot = "Root"); Aws::S3::S3Client MakeS3Client();