forked from ydb-platform/ydb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YDB FQ: Support MySQL as an external data source (ydb-platform#4951)
- Loading branch information
1 parent
48f5f33
commit b8f6256
Showing
6 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
ydb/library/yql/providers/generic/actors/yql_generic_provider_factories.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "yql_generic_provider_factories.h" | ||
|
||
#include "yql_generic_read_actor.h" | ||
#include "yql_generic_lookup_actor.h" | ||
|
||
#include <ydb/library/yql/dq/actors/compute/dq_compute_actor_async_io.h> | ||
|
||
namespace NYql::NDq { | ||
|
||
void RegisterGenericProviderFactories(TDqAsyncIoFactory& factory, | ||
ISecuredServiceAccountCredentialsFactory::TPtr credentialsFactory, | ||
NYql::NConnector::IClient::TPtr genericClient) { | ||
auto readActorFactory = [credentialsFactory, genericClient]( | ||
Generic::TSource&& settings, | ||
IDqAsyncIoFactory::TSourceArguments&& args) { | ||
return CreateGenericReadActor(genericClient, std::move(settings), args.InputIndex, args.StatsLevel, | ||
args.SecureParams, args.TaskParams, args.ComputeActorId, credentialsFactory, args.HolderFactory); | ||
}; | ||
|
||
auto lookupActorFactory = [credentialsFactory, genericClient](NYql::Generic::TLookupSource&& lookupSource, IDqAsyncIoFactory::TLookupSourceArguments&& args) { | ||
return CreateGenericLookupActor( | ||
genericClient, | ||
credentialsFactory, | ||
std::move(args.ParentId), | ||
args.Alloc, | ||
std::move(lookupSource), | ||
args.KeyType, | ||
args.PayloadType, | ||
args.TypeEnv, | ||
args.HolderFactory, | ||
args.MaxKeysInRequest); | ||
}; | ||
|
||
for (auto& name : {"ClickHouseGeneric", "PostgreSqlGeneric", "YdbGeneric", "MySqlGeneric"}) { | ||
factory.RegisterSource<Generic::TSource>(name, readActorFactory); | ||
factory.RegisterLookupSource<Generic::TLookupSource>(name, lookupActorFactory); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters