Skip to content

merge to yq stable YQ added YDB_AUTH_TICKET_HEADER for fq proxy ydb requests #15432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
cf6cb95
Revert "rework grpc monitoring (#11191)" (#12374) (#12376)
dorooleg Dec 6, 2024
404e8d2
Merge from stable (#12444)
vitalyisaev2 Dec 10, 2024
48009ff
YQ-3943 Fix TopicPartitionsLimitPerNode limit / to stable (#12433)
kardymonds Dec 10, 2024
c85ac9f
YQ-3912 Add read group to row dispatcher / to stable (#12434)
kardymonds Dec 10, 2024
995b753
streamlookup join: add lru size monitoring (backport #11303) (#12449)
yumkam Dec 10, 2024
146b12d
ContinueExecute on non-empty transform (backport #12201) (#12450)
yumkam Dec 10, 2024
5f4a78b
streamlookup: Fix UAF when GetAsyncInputData called before Bootstrap …
yumkam Dec 10, 2024
4759d57
YQ-3893 Fix next message offset in topic session / to stable (#12460)
kardymonds Dec 11, 2024
472861e
YQ-3738 RD pass UV from filter to read actor (#12466)
GrigoriyPA Dec 11, 2024
fc43113
YQ-3893 Remove query_id metrics on terminate / to stable (#12485)
kardymonds Dec 11, 2024
e98b6b8
YQ-3970 RD added parser mkql counters (#12615)
GrigoriyPA Dec 13, 2024
514a0c4
Merge from main (#12647)
vitalyisaev2 Dec 16, 2024
c302bf8
v1 has been fixed (#12730) (#12741)
dorooleg Dec 19, 2024
752521d
YQ-3975 RD fixed fault for parsing errors without filter (#12755)
GrigoriyPA Dec 19, 2024
4dd4793
YQ-3970 RD fixed memory leak in filters (#12756)
GrigoriyPA Dec 19, 2024
26680b7
YQ-3738 Fix metafields in read_actor / to stable (#12725)
kardymonds Dec 19, 2024
fc3965a
YQ fix code owners (#12783)
GrigoriyPA Dec 19, 2024
d73362a
Merge to q-stable-2024-12-05 (#12853)
dorooleg Dec 23, 2024
19724d9
YQ-3981 RD fixed missing historical data (#12842)
GrigoriyPA Dec 23, 2024
7b6232b
YQ-3926 RD added parallel purecalc compilation (#12892)
GrigoriyPA Dec 24, 2024
4292ec7
Fixed DQ Compute actor crash (#12987) (#13031)
evanevanevanevannnn Dec 26, 2024
24b1fa6
New http api (#13078)
what-the-fawk Dec 27, 2024
d9ef298
YDB FQ: fix streaming tests after refactoring (backport #12800 #12938…
yumkam Dec 28, 2024
8783e92
parse and pass streamlookup parameters (backport a079326cd0e258a50e30…
yumkam Dec 28, 2024
aaa413d
async ca monitoring page: add detailed channel and sink state (backpo…
yumkam Dec 28, 2024
82bac9c
less query id labels (#12427) (#12745)
uzhastik Jan 9, 2025
2f073c6
Add LookupSrc InFlight counter (backport #13228) (#13294)
yumkam Jan 13, 2025
b1f76f6
generic lookup: handle retrievable errors in grpc (backport #13119) (…
yumkam Jan 16, 2025
79dc6bb
generic lookup: enable tcp keep-alive on connector connection (backpo…
yumkam Jan 16, 2025
e8eccf2
Generic lookup add timeouts (backport #13239) (#13450)
yumkam Jan 17, 2025
6e9bff0
YQ-4017 / YQ-3947 / YQ-3988 / YQ-3871 to stable (#13355)
kardymonds Jan 20, 2025
1682684
YQ: 13491 / 13491 to stable (#13540)
kardymonds Jan 20, 2025
26419cc
FQ: YQ-3988 / to stable (#13569)
kardymonds Jan 20, 2025
c2b8d74
TEvRequestAuthAndCheck has been fixed for proxy_simple (#13028) (#13655)
dorooleg Jan 21, 2025
0a3f819
FQ: edit LatencyMs buckets count in Histogram / to stable (#13604)
kardymonds Jan 22, 2025
6f80afb
YQ-3949 fix pq source sensors names (#13107)
GrigoriyPA Jan 23, 2025
9065dc3
YQ-3893 Use one session read_actor <-> RD / to stable (#13649)
kardymonds Jan 23, 2025
7cae7ed
TotalCpuLimitPercentPerNode has been added to FQ WM (#13768) (#13782)
dorooleg Jan 23, 2025
1c132e0
Fix multiple streamlookup (backport #13426) (#13765)
yumkam Jan 24, 2025
dc6bb06
YQ-3924 Add compiler actors to cpu stats #13745 / to stable (#13792)
kardymonds Jan 24, 2025
00c237b
YQ-4050 Fix row dispatcher disconnects / cookie / to stable (#13885)
kardymonds Jan 27, 2025
d929538
streamlookup: fix FreeSpace accounting (backport #12744) (#13889)
yumkam Jan 29, 2025
26c39e3
generic lookup: pad queries to improve query cachability (#10506) (#1…
yumkam Jan 29, 2025
eced81b
checkpoint storage: fix future handling on error path (backport #1390…
yumkam Jan 29, 2025
03a54f8
checkoint coordinator: handle failure on saving zero checkpoint (back…
yumkam Jan 29, 2025
fe0a01d
merge to yq stable YQ-4052 fixed url escaping for s3 insert (#13997)
GrigoriyPA Jan 30, 2025
8663e7c
YQ: fix read_actor log message size / to stable (#13958)
kardymonds Jan 30, 2025
65fb266
ReconnectPeriod has been fixed for pq_read_actor (#13921) (#13941)
dorooleg Jan 30, 2025
2dede2b
YQ-4049 / YQ-4071 Sink fq to stable (#14018)
kardymonds Feb 3, 2025
c009b69
YQ-3858 RowDispatcher / Add new public metrics / to stable (#14157)
kardymonds Feb 4, 2025
ae3ca4f
checkpoint storage: use more query parameters and settings (backport …
yumkam Feb 4, 2025
36884b0
YQ-4085 FQ: Add partition id check in row dispatcher #14178 / to stab…
kardymonds Feb 4, 2025
11a2631
merge to yq stable YQ-4053 support parallel s3 import (#14175)
GrigoriyPA Feb 4, 2025
fdf539d
YQ-4091 Delete public metrics if automatic query (#14288) / to stable…
kardymonds Feb 10, 2025
f872253
YQ-3924 / YQ-4095 Fix actor name / memory leak / to stable (#14366)
kardymonds Feb 10, 2025
772fabd
merge to yq stable YQ-4104 fixed fault on sink error (#14471)
GrigoriyPA Feb 12, 2025
046e3ca
YQ-4111 Fix row dispatcher statistics #14574 / to stable (#14627)
kardymonds Feb 17, 2025
03cb887
merge to yq stable YQ remove anonymous namespace from CA (#14657)
GrigoriyPA Feb 17, 2025
f454f01
YQ-4121 Check generation by TEvNoSession / to stable (#14798)
kardymonds Feb 19, 2025
9e8341f
CA: LastRunStatus was always overwritten (backport #14710) (#14814)
yumkam Feb 20, 2025
95333f6
pq write: pass query/task info into sdk logs (backport #14477, #14884…
yumkam Feb 24, 2025
ac1ae9a
generic lookup: use retry_policy library (backport #13460) (#14956)
yumkam Mar 3, 2025
f5580fd
merge to yq stable YQ-3561 support fq run (#15132)
GrigoriyPA Mar 4, 2025
07f4918
YQ added YDB_AUTH_TICKET_HEADER for fq proxy ydb requests (#15416)
GrigoriyPA Mar 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 1 addition & 54 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,54 +1 @@
/*.md @ydb-platform/docs

/build @ydb-platform/ci
/certs @ydb-platform/ci
/contrib @ydb-platform/ci
/devtools @ydb-platform/ci
/library @ydb-platform/ci
/scripts @ydb-platform/ci
/tools @ydb-platform/ci
/util @ydb-platform/ci
/vendor @ydb-platform/ci
/yql @ydb-platform/ci
/yt @ydb-platform/ci

/ydb/core/fq/ @ydb-platform/fq
/ydb/core/public_http/ @ydb-platform/fq

/ydb/docs/ @ydb-platform/docs

/ydb/library/yql/ @ydb-platform/yql
/ydb/library/yql/dq @ydb-platform/yql @ydb-platform/qp
/ydb/library/yql/dq/actors/common @ydb-platform/fq
/ydb/library/yql/providers/common/http_gateway @ydb-platform/fq
/ydb/library/yql/providers/common/db_id_async_resolver @ydb-platform/fq
/ydb/library/yql/providers/common/pushdown @ydb-platform/fq
/ydb/library/yql/providers/generic @ydb-platform/fq
/ydb/library/yql/providers/pq @ydb-platform/fq
/ydb/library/yql/providers/s3 @ydb-platform/fq
/ydb/library/yql/providers/solomon @ydb-platform/fq
/ydb/library/yql/tests/sql/solomon @ydb-platform/fq
/ydb/library/yql/tests/sql/suites/solomon @ydb-platform/fq
/ydb/library/yql/udfs/common/clickhouse/client @ydb-platform/fq

/ydb/library/yql/yt @Krock21 @Krisha11 @zlobober @gritukan

/ydb/services/fq/ @ydb-platform/fq

/ydb/core/kafka_proxy @ydb-platform/Topics
/ydb/core/persqueue @ydb-platform/Topics
/ydb/services/datastreams @ydb-platform/Topics
/ydb/services/deprecated/persqueue_v0 @ydb-platform/Topics
/ydb/services/persqueue_v1 @ydb-platform/Topics

/ydb/core/config/ut @ydb-platform/core

/ydb/core/viewer @ydb-platform/ui-backend
/ydb/core/protos/node_whiteboard.proto @ydb-platform/ui-backend

/ydb/core/formats/arrow @ydb-platform/cs
/ydb/core/tx/columnshard @ydb-platform/cs

/ydb/apps/ydb @ydb-platform/cli
/ydb/public/lib/ydb_cli @ydb-platform/cli

* @ydb-platform/fq
31 changes: 31 additions & 0 deletions ydb/core/driver_lib/run/config_helpers.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include "config_helpers.h"

#include <ydb/core/base/localdb.h>
#include <ydb/core/protos/bootstrap.pb.h>
#include <ydb/core/protos/resource_broker.pb.h>

#include <ydb/library/actors/util/affinity.h>


Expand Down Expand Up @@ -114,4 +118,31 @@ NActors::TSchedulerConfig CreateSchedulerConfig(const NKikimrConfig::TActorSyste

} // namespace NActorSystemConfigHelpers

namespace NKikimrConfigHelpers {

NMemory::TResourceBrokerConfig CreateMemoryControllerResourceBrokerConfig(const NKikimrConfig::TAppConfig& config) {
NMemory::TResourceBrokerConfig resourceBrokerSelfConfig; // for backward compatibility
auto mergeResourceBrokerConfigs = [&](const NKikimrResourceBroker::TResourceBrokerConfig& resourceBrokerConfig) {
if (resourceBrokerConfig.HasResourceLimit() && resourceBrokerConfig.GetResourceLimit().HasMemory()) {
resourceBrokerSelfConfig.LimitBytes = resourceBrokerConfig.GetResourceLimit().GetMemory();
}
for (const auto& queue : resourceBrokerConfig.GetQueues()) {
if (queue.GetName() == NLocalDb::KqpResourceManagerQueue) {
if (queue.HasLimit() && queue.GetLimit().HasMemory()) {
resourceBrokerSelfConfig.QueryExecutionLimitBytes = queue.GetLimit().GetMemory();
}
}
}
};
if (config.HasBootstrapConfig() && config.GetBootstrapConfig().HasResourceBroker()) {
mergeResourceBrokerConfigs(config.GetBootstrapConfig().GetResourceBroker());
}
if (config.HasResourceBrokerConfig()) {
mergeResourceBrokerConfigs(config.GetResourceBrokerConfig());
}
return resourceBrokerSelfConfig;
}

} // namespace NKikimrConfigHelpers

} // namespace NKikimr
7 changes: 7 additions & 0 deletions ydb/core/driver_lib/run/config_helpers.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <ydb/core/memory_controller/memory_controller.h>
#include <ydb/core/protos/config.pb.h>

#include <ydb/library/actors/core/config.h>
Expand All @@ -15,4 +16,10 @@ NActors::TSchedulerConfig CreateSchedulerConfig(const NKikimrConfig::TActorSyste

} // namespace NActorSystemConfigHelpers

namespace NKikimrConfigHelpers {

NMemory::TResourceBrokerConfig CreateMemoryControllerResourceBrokerConfig(const NKikimrConfig::TAppConfig& config);

} // namespace NKikimrConfigHelpers

} // namespace NKikimr
22 changes: 1 addition & 21 deletions ydb/core/driver_lib/run/kikimr_services_initializers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2049,28 +2049,8 @@ void TMemoryControllerInitializer::InitializeServices(
NActors::TActorSystemSetup* setup,
const NKikimr::TAppData* appData)
{
NMemory::TResourceBrokerConfig resourceBrokerSelfConfig; // for backward compatibility
auto mergeResourceBrokerConfigs = [&](const NKikimrResourceBroker::TResourceBrokerConfig& resourceBrokerConfig) {
if (resourceBrokerConfig.HasResourceLimit() && resourceBrokerConfig.GetResourceLimit().HasMemory()) {
resourceBrokerSelfConfig.LimitBytes = resourceBrokerConfig.GetResourceLimit().GetMemory();
}
for (const auto& queue : resourceBrokerConfig.GetQueues()) {
if (queue.GetName() == NLocalDb::KqpResourceManagerQueue) {
if (queue.HasLimit() && queue.GetLimit().HasMemory()) {
resourceBrokerSelfConfig.QueryExecutionLimitBytes = queue.GetLimit().GetMemory();
}
}
}
};
if (Config.HasBootstrapConfig() && Config.GetBootstrapConfig().HasResourceBroker()) {
mergeResourceBrokerConfigs(Config.GetBootstrapConfig().GetResourceBroker());
}
if (Config.HasResourceBrokerConfig()) {
mergeResourceBrokerConfigs(Config.GetResourceBrokerConfig());
}

auto* actor = NMemory::CreateMemoryController(TDuration::Seconds(1), ProcessMemoryInfoProvider,
Config.GetMemoryControllerConfig(), resourceBrokerSelfConfig,
Config.GetMemoryControllerConfig(), NKikimrConfigHelpers::CreateMemoryControllerResourceBrokerConfig(Config),
appData->Counters);
setup->LocalServices.emplace_back(
NMemory::MakeMemoryControllerId(0),
Expand Down
82 changes: 82 additions & 0 deletions ydb/core/external_sources/s3/ut/s3_aws_credentials_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,88 @@ Y_UNIT_TEST_SUITE(S3AwsCredentials) {
}

}

Y_UNIT_TEST(TestInsertEscaping) {
const TString externalDataSourceName = "/Root/external_data_source";
auto s3ActorsFactory = NYql::NDq::CreateS3ActorsFactory();
auto kikimr = MakeKikimrRunner(true, nullptr, nullptr, std::nullopt, s3ActorsFactory);

auto tc = kikimr->GetTableClient();
auto session = tc.CreateSession().GetValueSync().GetSession();
const TString query = fmt::format(R"(
CREATE OBJECT id (TYPE SECRET) WITH (value=`minio`);
CREATE OBJECT key (TYPE SECRET) WITH (value=`minio123`);
CREATE EXTERNAL DATA SOURCE `{external_source}` WITH (
SOURCE_TYPE="ObjectStorage",
LOCATION="{location}",
AUTH_METHOD="AWS",
AWS_ACCESS_KEY_ID_SECRET_NAME="id",
AWS_SECRET_ACCESS_KEY_SECRET_NAME="key",
AWS_REGION="ru-central-1"
);
)",
"external_source"_a = externalDataSourceName,
"location"_a = "localhost:" + GetExternalPort("minio", "9000") + "/datalake/"
);

auto result = session.ExecuteSchemeQuery(query).GetValueSync();
UNIT_ASSERT_C(result.GetStatus() == NYdb::EStatus::SUCCESS, result.GetIssues().ToString());

WaitBucket(kikimr, externalDataSourceName);

auto db = kikimr->GetQueryClient();

TString path = TStringBuilder() << "exp_folder/some_" << EscapeC(GetSymbolsString(' ', '~', "*?{}`")) << "\\`";

{
// NB: AtomicUploadCommit = "false" because in minio ListMultipartUploads by prefix is not supported
auto scriptExecutionOperation = db.ExecuteScript(fmt::format(R"(
PRAGMA s3.AtomicUploadCommit = "false";
INSERT INTO `{external_source}`.`{path}/` WITH (FORMAT = "csv_with_names")
SELECT * FROM `{external_source}`.`/a/` WITH (
format="json_each_row",
schema(
key Utf8 NOT NULL,
value Utf8 NOT NULL
)
)
)", "external_source"_a = externalDataSourceName, "path"_a = path)).ExtractValueSync();
UNIT_ASSERT_VALUES_EQUAL_C(scriptExecutionOperation.Status().GetStatus(), EStatus::SUCCESS, scriptExecutionOperation.Status().GetIssues().ToString());
UNIT_ASSERT(!scriptExecutionOperation.Metadata().ExecutionId.empty());

NYdb::NQuery::TScriptExecutionOperation readyOp = WaitScriptExecutionOperation(scriptExecutionOperation.Id(), kikimr->GetDriver());
UNIT_ASSERT_EQUAL_C(readyOp.Metadata().ExecStatus, EExecStatus::Completed, readyOp.Status().GetIssues().ToString());
}

{
auto scriptExecutionOperation = db.ExecuteScript(fmt::format(R"(
SELECT * FROM `{external_source}`.`{path}/` WITH (
format="csv_with_names",
schema(
key Utf8 NOT NULL,
value Utf8 NOT NULL
)
)
)", "external_source"_a = externalDataSourceName, "path"_a = path)).ExtractValueSync();
UNIT_ASSERT_VALUES_EQUAL_C(scriptExecutionOperation.Status().GetStatus(), EStatus::SUCCESS, scriptExecutionOperation.Status().GetIssues().ToString());
UNIT_ASSERT(!scriptExecutionOperation.Metadata().ExecutionId.empty());

NYdb::NQuery::TScriptExecutionOperation readyOp = WaitScriptExecutionOperation(scriptExecutionOperation.Id(), kikimr->GetDriver());
UNIT_ASSERT_EQUAL_C(readyOp.Metadata().ExecStatus, EExecStatus::Completed, readyOp.Status().GetIssues().ToString());
TFetchScriptResultsResult results = db.FetchScriptResults(scriptExecutionOperation.Id(), 0).ExtractValueSync();
UNIT_ASSERT_C(results.IsSuccess(), results.GetIssues().ToString());

TResultSetParser resultSet(results.ExtractResultSet());
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");
}
}
}

} // namespace NKikimr::NKqp
67 changes: 45 additions & 22 deletions ydb/core/fq/libs/actors/clusters_from_connections.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "clusters_from_connections.h"

#include <yql/essentials/providers/common/provider/yql_provider_names.h>
#include <ydb/library/yql/providers/generic/connector/api/common/data_source.pb.h>
#include <yql/essentials/providers/common/proto/gateways_config.pb.h>
#include <ydb/library/yql/providers/generic/provider/yql_generic_cluster_config.h>
#include <yql/essentials/utils/url_builder.h>
#include <ydb/library/actors/http/http.h>
Expand Down Expand Up @@ -88,6 +88,19 @@ std::pair<TString, bool> ParseHttpEndpoint(const TString& endpoint) {
return std::make_pair(ToString(host), scheme != "http");
}

std::pair<TString, TIpPort> ParseGrpcEndpoint(const TString& endpoint) {
TStringBuf scheme;
TStringBuf address;
TStringBuf uri;
NHttp::CrackURL(endpoint, scheme, address, uri);

TString hostname;
TIpPort port;
NHttp::CrackAddress(TString(address), hostname, port);

return {hostname, port};
}

void FillSolomonClusterConfig(NYql::TSolomonClusterConfig& clusterConfig,
const TString& name,
const TString& authToken,
Expand All @@ -112,7 +125,7 @@ void FillGenericClusterConfigBase(
TGenericClusterConfig& clusterCfg,
const TConnection& connection,
const TString& connectionName,
NConnector::NApi::EDataSourceKind dataSourceKind,
NYql::EGenericDataSourceKind dataSourceKind,
const TString& authToken,
const THashMap<TString, TString>& accountIdSignatures
) {
Expand All @@ -128,21 +141,21 @@ void FillGenericClusterConfigBase(
// In YQv1 we just hardcode the appropriate protocols here.
// In YQv2 protocol can be configured via `CREATE EXTERNAL DATA SOURCE` params.
switch (dataSourceKind) {
case NYql::NConnector::NApi::CLICKHOUSE:
clusterCfg.SetProtocol(common.GetUseNativeProtocolForClickHouse() ? NYql::NConnector::NApi::EProtocol::NATIVE : NYql::NConnector::NApi::EProtocol::HTTP);
case NYql::EGenericDataSourceKind::CLICKHOUSE:
clusterCfg.SetProtocol(common.GetUseNativeProtocolForClickHouse() ? NYql::EGenericProtocol::NATIVE : NYql::EGenericProtocol::HTTP);
break;
case NYql::NConnector::NApi::GREENPLUM:
clusterCfg.SetProtocol(NYql::NConnector::NApi::EProtocol::NATIVE);
case NYql::EGenericDataSourceKind::GREENPLUM:
clusterCfg.SetProtocol(NYql::EGenericProtocol::NATIVE);
break;
case NYql::NConnector::NApi::MYSQL:
clusterCfg.SetProtocol(NYql::NConnector::NApi::EProtocol::NATIVE);
case NYql::EGenericDataSourceKind::MYSQL:
clusterCfg.SetProtocol(NYql::EGenericProtocol::NATIVE);
break;
case NYql::NConnector::NApi::POSTGRESQL:
clusterCfg.SetProtocol(NYql::NConnector::NApi::EProtocol::NATIVE);
case NYql::EGenericDataSourceKind::POSTGRESQL:
clusterCfg.SetProtocol(NYql::EGenericProtocol::NATIVE);
break;
default:
ythrow yexception() << "Unexpected data source kind: '"
<< NYql::NConnector::NApi::EDataSourceKind_Name(dataSourceKind) << "'";
<< NYql::EGenericDataSourceKind_Name(dataSourceKind) << "'";
}

ValidateGenericClusterConfig(clusterCfg, "NFq::FillGenericClusterFromConfig");
Expand All @@ -154,7 +167,7 @@ void FillGenericClusterConfig(
TGenericClusterConfig& clusterCfg,
const TConnection& connection,
const TString& connectionName,
NConnector::NApi::EDataSourceKind dataSourceKind,
NYql::EGenericDataSourceKind dataSourceKind,
const TString& authToken,
const THashMap<TString, TString>& accountIdSignatures
) {
Expand All @@ -167,7 +180,7 @@ void FillGenericClusterConfig<FederatedQuery::PostgreSQLCluster>(
TGenericClusterConfig& clusterCfg,
const FederatedQuery::PostgreSQLCluster& connection,
const TString& connectionName,
NConnector::NApi::EDataSourceKind dataSourceKind,
NYql::EGenericDataSourceKind dataSourceKind,
const TString& authToken,
const THashMap<TString, TString>& accountIdSignatures
){
Expand Down Expand Up @@ -227,11 +240,21 @@ void AddClustersFromConnections(
case FederatedQuery::ConnectionSetting::kYdbDatabase: {
const auto& db = conn.content().setting().ydb_database();
auto* clusterCfg = gatewaysConfig.MutableGeneric()->AddClusterMapping();
clusterCfg->SetKind(NYql::NConnector::NApi::EDataSourceKind::YDB);
clusterCfg->SetProtocol(NYql::NConnector::NApi::EProtocol::NATIVE);
clusterCfg->SetKind(NYql::EGenericDataSourceKind::YDB);
clusterCfg->SetProtocol(NYql::EGenericProtocol::NATIVE);
clusterCfg->SetName(connectionName);
clusterCfg->SetDatabaseId(db.database_id());
clusterCfg->SetUseSsl(!common.GetDisableSslForGenericDataSources());
if (const auto& databaseId = db.database_id()) {
clusterCfg->SetDatabaseId(databaseId);
clusterCfg->SetUseSsl(!common.GetDisableSslForGenericDataSources());
} else {
const auto& [host, port] = ParseGrpcEndpoint(db.endpoint());

auto& endpoint = *clusterCfg->MutableEndpoint();
endpoint.set_host(host);
endpoint.set_port(port);
clusterCfg->SetUseSsl(db.secure());
clusterCfg->SetDatabaseName(db.database());
}
FillClusterAuth(*clusterCfg, db.auth(), authToken, accountIdSignatures);
clusters.emplace(connectionName, GenericProviderName);
break;
Expand All @@ -242,7 +265,7 @@ void AddClustersFromConnections(
*gatewaysConfig.MutableGeneric()->AddClusterMapping(),
conn.content().setting().clickhouse_cluster(),
connectionName,
NYql::NConnector::NApi::EDataSourceKind::CLICKHOUSE,
NYql::EGenericDataSourceKind::CLICKHOUSE,
authToken,
accountIdSignatures);
clusters.emplace(connectionName, GenericProviderName);
Expand Down Expand Up @@ -275,7 +298,7 @@ void AddClustersFromConnections(
*gatewaysConfig.MutableGeneric()->AddClusterMapping(),
conn.content().setting().postgresql_cluster(),
connectionName,
NYql::NConnector::NApi::EDataSourceKind::POSTGRESQL,
NYql::EGenericDataSourceKind::POSTGRESQL,
authToken,
accountIdSignatures);
clusters.emplace(connectionName, GenericProviderName);
Expand All @@ -287,7 +310,7 @@ void AddClustersFromConnections(
*gatewaysConfig.MutableGeneric()->AddClusterMapping(),
conn.content().setting().greenplum_cluster(),
connectionName,
NYql::NConnector::NApi::EDataSourceKind::GREENPLUM,
NYql::EGenericDataSourceKind::GREENPLUM,
authToken,
accountIdSignatures);
clusters.emplace(connectionName, GenericProviderName);
Expand All @@ -299,7 +322,7 @@ void AddClustersFromConnections(
*gatewaysConfig.MutableGeneric()->AddClusterMapping(),
conn.content().setting().mysql_cluster(),
connectionName,
NYql::NConnector::NApi::EDataSourceKind::MYSQL,
NYql::EGenericDataSourceKind::MYSQL,
authToken,
accountIdSignatures);
clusters.emplace(connectionName, GenericProviderName);
Expand All @@ -308,7 +331,7 @@ void AddClustersFromConnections(
case FederatedQuery::ConnectionSetting::kLogging: {
const auto& connection = conn.content().setting().logging();
auto* clusterCfg = gatewaysConfig.MutableGeneric()->AddClusterMapping();
clusterCfg->SetKind(NYql::NConnector::NApi::EDataSourceKind::LOGGING);
clusterCfg->SetKind(NYql::EGenericDataSourceKind::LOGGING);
clusterCfg->SetName(connectionName);
clusterCfg->mutable_datasourceoptions()->insert({"folder_id", connection.folder_id()});
FillClusterAuth(*clusterCfg, connection.auth(), authToken, accountIdSignatures);
Expand Down
Loading
Loading