diff options
author | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-12-12 15:00:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-12 15:00:43 +0000 |
commit | 42701242eaf5be980cb935631586d0e90b82641c (patch) | |
tree | 6dbf5fcd37d3c16591e196c4a69d166e3ab3a398 /yql/essentials/providers/common/proto | |
parent | 7f5a9f394dbd9ac290cabbb7977538656b3a541e (diff) | |
parent | f7c04b5876af3d16849ab5e3079c0eabbd4e3a00 (diff) | |
download | ydb-42701242eaf5be980cb935631586d0e90b82641c.tar.gz |
Merge pull request #12554 from vitalyisaev2/YQ-3839.with_rightlib.3
Import from Arcadia + YDB FQ: turning gateways_config.proto into a file without external dependencies
Diffstat (limited to 'yql/essentials/providers/common/proto')
-rw-r--r-- | yql/essentials/providers/common/proto/gateways_config.proto | 129 | ||||
-rw-r--r-- | yql/essentials/providers/common/proto/ya.make | 1 |
2 files changed, 119 insertions, 11 deletions
diff --git a/yql/essentials/providers/common/proto/gateways_config.proto b/yql/essentials/providers/common/proto/gateways_config.proto index 875ccaa22f..977ab2e7b9 100644 --- a/yql/essentials/providers/common/proto/gateways_config.proto +++ b/yql/essentials/providers/common/proto/gateways_config.proto @@ -2,8 +2,6 @@ package NYql; option java_package = "ru.yandex.yql.proto"; import "yql/essentials/protos/clickhouse.proto"; -import "ydb/library/yql/providers/generic/connector/api/common/data_source.proto"; -import "ydb/library/yql/providers/generic/connector/api/common/endpoint.proto"; /////////////////////////////// common /////////////////////////////// @@ -552,29 +550,140 @@ message TDbToolConfig { /////////// Generic gateway for the external data sources //////////// +// TGenericEndpoint represents the network address of a generic data source instance +message TGenericEndpoint { + optional string host = 1; + optional uint32 port = 2; +} + + +// TGenericCredentials represents various ways of user authentication in the data source instance +message TGenericCredentials { + message TBasic { + optional string username = 1; + optional string password = 2; + } + + message TToken { + optional string type = 1; + optional string value = 2; + } + + oneof payload { + TBasic basic = 1; + TToken token = 2; + } +} + +// EGenericDataSourceKind enumerates the external data sources +// supported by the federated query system +enum EGenericDataSourceKind { + DATA_SOURCE_KIND_UNSPECIFIED = 0; + CLICKHOUSE = 1; + POSTGRESQL = 2; + S3 = 3; + YDB = 4; + MYSQL = 5; + MS_SQL_SERVER = 6; + GREENPLUM = 7; + ORACLE = 8; + LOGGING = 9; +} + +// EGenericProtocol generalizes various kinds of network protocols supported by different databases. +enum EGenericProtocol { + PROTOCOL_UNSPECIFIED = 0; + NATIVE = 1; // CLICKHOUSE, POSTGRESQL + HTTP = 2; // CLICKHOUSE, S3 +} + +// TPostgreSQLDataSourceOptions represents settings specific to PostgreSQL +message TPostgreSQLDataSourceOptions { + // PostgreSQL schema + optional string schema = 1; +} + +// TClickhouseDataSourceOptions represents settings specific to Clickhouse +message TClickhouseDataSourceOptions { +} + +// TS3DataSourceOptions represents settings specific to S3 (Simple Storage Service) +message TS3DataSourceOptions { + // the region where data is stored + optional string region = 1; + // the bucket the object belongs to + optional string bucket = 2; +} + +// TGreenplumDataSourceOptions represents settings specific to Greenplum +message TGreenplumDataSourceOptions { + // Greenplum schema + optional string schema = 1; +} + +// TOracleDataSourceOptions represents settings specific to Oracle +message TOracleDataSourceOptions { + // Oracle service_name - alias to SID of oracle INSTANCE, or SID, or PDB. + // More about connection options in Oracle docs: + // https://docs.oracle.com/en/database/other-databases/essbase/21/essoa/connection-string-formats.html + optional string service_name = 1; +} + +// TLoggingDataSourceOptions represents settings specific to Logging +message TLoggingDataSourceOptions { + optional string folder_id = 1; +} + +// TGenericDataSourceInstance helps to identify the instance of a data source to redirect request to. +message TGenericDataSourceInstance { + // Data source kind + optional EGenericDataSourceKind kind = 1; + // Network address + optional TGenericEndpoint endpoint = 2; + // Database name + optional string database = 3; + // Credentials to access database + optional TGenericCredentials credentials = 4; + // If true, Connector server will use secure connections to access remote data sources. + // Certificates will be obtained from the standard system paths. + optional bool use_tls = 5; + // Allows to specify network protocol that should be used between + // during the connection between Connector and the remote data source + optional EGenericProtocol protocol = 6; + // Options specific to various data sources + oneof options { + TPostgreSQLDataSourceOptions pg_options = 7; + TClickhouseDataSourceOptions ch_options = 8; + TS3DataSourceOptions s3_options = 9; + TGreenplumDataSourceOptions gp_options = 10; + TOracleDataSourceOptions oracle_options = 11; + TLoggingDataSourceOptions logging_options = 12; + } +} + message TGenericClusterConfig { // Cluster name optional string Name = 1; // Data source kind - optional NYql.NConnector.NApi.EDataSourceKind Kind = 8; + optional EGenericDataSourceKind Kind = 8; // Location represents the network address of a data source instance we want to connect oneof Location { // Endpoint must be used for on-premise deployments. - NYql.NConnector.NApi.TEndpoint Endpoint = 9; + TGenericEndpoint Endpoint = 9; // DatabaseId must be used when the data source is deployed in cloud. // Data source FQDN and port will be resolved by MDB service. string DatabaseId = 4; } // Credentials used to access data source instance - optional NYql.NConnector.NApi.TCredentials Credentials = 10; + optional TGenericCredentials Credentials = 10; // Credentials used to access managed databases APIs. // When working with external data source instances deployed in clouds, - // one should either set (ServiceAccountId, ServiceAccountIdSignature) pair - // that will be resolved into IAM Token via Token Accessor, + // one should either set (ServiceAccountId, ServiceAccountIdSignature) pair + // that will be resolved into IAM Token via Token Accessor, // or provide IAM Token directly. optional string ServiceAccountId = 6; optional string ServiceAccountIdSignature = 7; @@ -588,7 +697,7 @@ message TGenericClusterConfig { optional string DatabaseName = 13; // Transport protocol used to establish a network connection with database - optional NYql.NConnector.NApi.EProtocol Protocol = 14; + optional EGenericProtocol Protocol = 14; // Data source options specific to various data sources map<string, string> DataSourceOptions = 15; @@ -601,7 +710,7 @@ message TGenericConnectorConfig { // 1. Set address statically via `Endpoint.Host` and `Endpoint.Port`; // 2. Ask YDB to set `Endpoint.Port` to the value of expression `./ydbd --ic-port + OffsetFromIcPort`, // while Connector's hostname will still be taken from `Endpoint.Host` (with 'localhost' as a default value). - optional NYql.NConnector.NApi.TEndpoint Endpoint = 3; + optional TGenericEndpoint Endpoint = 3; optional uint32 OffsetFromIcPort = 6; // If true, Connector GRPC Client will use TLS encryption. @@ -638,7 +747,7 @@ message TGenericGatewayConfig { message TDbResolverConfig { // Ydb / Yds MVP endpoint. - // Expected format: + // Expected format: // [http|https]://host:port/ydbc/cloud-prod/ optional string YdbMvpEndpoint = 2; } diff --git a/yql/essentials/providers/common/proto/ya.make b/yql/essentials/providers/common/proto/ya.make index 6ce6a6c99c..eefd4c6b72 100644 --- a/yql/essentials/providers/common/proto/ya.make +++ b/yql/essentials/providers/common/proto/ya.make @@ -7,7 +7,6 @@ SRCS( PEERDIR( yql/essentials/protos - ydb/library/yql/providers/generic/connector/api/common ) IF (NOT PY_PROTOS_FOR) |