diff --git a/ydb/core/base/appdata.h b/ydb/core/base/appdata.h index bdaab3f42b0d..86efb76c9c2c 100644 --- a/ydb/core/base/appdata.h +++ b/ydb/core/base/appdata.h @@ -11,7 +11,6 @@ #include "event_filter.h" #include -#include #include #include #include diff --git a/ydb/core/base/appdata_fwd.h b/ydb/core/base/appdata_fwd.h index 4a665805a862..329183c5afce 100644 --- a/ydb/core/base/appdata_fwd.h +++ b/ydb/core/base/appdata_fwd.h @@ -102,10 +102,6 @@ namespace NYdb { namespace NKikimr { -namespace NExternalSource { - struct IExternalSourceFactory; -} - namespace NScheme { class TTypeRegistry; } @@ -152,8 +148,6 @@ struct TAppData { const NDataShard::IExportFactory *DataShardExportFactory = nullptr; const TFormatFactory* FormatFactory = nullptr; const NSQS::IEventsWriterFactory* SqsEventsWriterFactory = nullptr; - TIntrusivePtr ExternalSourceFactory = nullptr; - NSQS::IAuthFactory* SqsAuthFactory = nullptr; diff --git a/ydb/core/driver_lib/run/run.cpp b/ydb/core/driver_lib/run/run.cpp index 58faf4d8d5ab..69ac30badc98 100644 --- a/ydb/core/driver_lib/run/run.cpp +++ b/ydb/core/driver_lib/run/run.cpp @@ -996,13 +996,6 @@ void TKikimrRunner::InitializeAppData(const TKikimrRunConfig& runConfig) AppData->PersQueueGetReadSessionsInfoWorkerFactory = ModuleFactories ? ModuleFactories->PQReadSessionsInfoWorkerFactory.get() : nullptr; AppData->IoContextFactory = ModuleFactories ? ModuleFactories->IoContextFactory.get() : nullptr; - std::vector hostnamePatterns; - if (runConfig.AppConfig.HasQueryServiceConfig()) { - const auto& patterns = runConfig.AppConfig.GetQueryServiceConfig().GetHostnamePatterns(); - hostnamePatterns = {patterns.begin(), patterns.end()}; - } - AppData->ExternalSourceFactory = NExternalSource::CreateExternalSourceFactory(hostnamePatterns); - AppData->SqsAuthFactory = ModuleFactories ? ModuleFactories->SqsAuthFactory.get() : nullptr; diff --git a/ydb/core/kqp/host/kqp_host.cpp b/ydb/core/kqp/host/kqp_host.cpp index c32cac00dfd1..750fe8120dbc 100644 --- a/ydb/core/kqp/host/kqp_host.cpp +++ b/ydb/core/kqp/host/kqp_host.cpp @@ -1517,8 +1517,8 @@ class TKqpHost : public IKqpHost { auto queryExecutor = MakeIntrusive(Gateway, Cluster, SessionCtx, KqpRunner); auto kikimrDataSource = CreateKikimrDataSource(*FuncRegistry, *TypesCtx, gatewayProxy, SessionCtx, - AppData()->ExternalSourceFactory, IsInternalCall); - auto kikimrDataSink = CreateKikimrDataSink(*FuncRegistry, *TypesCtx, gatewayProxy, SessionCtx, AppData()->ExternalSourceFactory, queryExecutor); + ExternalSourceFactory, IsInternalCall); + auto kikimrDataSink = CreateKikimrDataSink(*FuncRegistry, *TypesCtx, gatewayProxy, SessionCtx, ExternalSourceFactory, queryExecutor); FillSettings.AllResultsBytesLimit = Nothing(); FillSettings.RowsLimitPerWrite = SessionCtx->Config()._ResultRowsLimit.Get(); @@ -1649,6 +1649,7 @@ class TKqpHost : public IKqpHost { TIntrusivePtr ExecuteCtx; TIntrusivePtr KqpRunner; + NExternalSource::IExternalSourceFactory::TPtr ExternalSourceFactory{NExternalSource::CreateExternalSourceFactory({})}; TKqpTempTablesState::TConstPtr TempTablesState; NActors::TActorSystem* ActorSystem = nullptr; diff --git a/ydb/core/testlib/actors/test_runtime.cpp b/ydb/core/testlib/actors/test_runtime.cpp index 1cfe3cb3587b..7a5dfb51cba7 100644 --- a/ydb/core/testlib/actors/test_runtime.cpp +++ b/ydb/core/testlib/actors/test_runtime.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -154,12 +153,6 @@ namespace NActors { nodeAppData->S3ProxyResolverConfig = app0->S3ProxyResolverConfig; nodeAppData->EnableMvccSnapshotWithLegacyDomainRoot = app0->EnableMvccSnapshotWithLegacyDomainRoot; nodeAppData->IoContextFactory = app0->IoContextFactory; - if (app0->ExternalSourceFactory) { - nodeAppData->ExternalSourceFactory = app0->ExternalSourceFactory; - } else { - nodeAppData->ExternalSourceFactory = NKikimr::NExternalSource::CreateExternalSourceFactory({}); - } - if (KeyConfigGenerator) { nodeAppData->KeyConfig = KeyConfigGenerator(nodeIndex); } else { diff --git a/ydb/core/testlib/test_client.cpp b/ydb/core/testlib/test_client.cpp index 1100e4faa118..6ef5ad171ce5 100644 --- a/ydb/core/testlib/test_client.cpp +++ b/ydb/core/testlib/test_client.cpp @@ -245,8 +245,6 @@ namespace Tests { appData.DataStreamsAuthFactory = Settings->DataStreamsAuthFactory.get(); appData.PersQueueMirrorReaderFactory = Settings->PersQueueMirrorReaderFactory.get(); appData.HiveConfig.MergeFrom(Settings->AppConfig->GetHiveConfig()); - const auto& hostnamePatterns = Settings->AppConfig->GetQueryServiceConfig().GetHostnamePatterns(); - appData.ExternalSourceFactory = NExternalSource::CreateExternalSourceFactory(std::vector(hostnamePatterns.begin(), hostnamePatterns.end())); appData.DynamicNameserviceConfig = new TDynamicNameserviceConfig; auto dnConfig = appData.DynamicNameserviceConfig; diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.cpp b/ydb/core/tx/schemeshard/schemeshard_impl.cpp index 64f08c8e3144..55026ab3b282 100644 --- a/ydb/core/tx/schemeshard/schemeshard_impl.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_impl.cpp @@ -4271,7 +4271,6 @@ void TSchemeShard::OnActivateExecutor(const TActorContext &ctx) { EnableStatistics = appData->FeatureFlags.GetEnableStatistics(); EnableTablePgTypes = appData->FeatureFlags.GetEnableTablePgTypes(); EnableServerlessExclusiveDynamicNodes = appData->FeatureFlags.GetEnableServerlessExclusiveDynamicNodes(); - ExternalSourceFactory = appData->ExternalSourceFactory; ConfigureCompactionQueues(appData->CompactionConfig, ctx); ConfigureStatsBatching(appData->SchemeShardConfig, ctx); @@ -6720,6 +6719,11 @@ void TSchemeShard::ApplyConsoleConfigs(const NKikimrConfig::TAppConfig& appConfi LoadTableProfiles(nullptr, ctx); } + if (appConfig.HasQueryServiceConfig()) { + const auto& hostnamePatterns = appConfig.GetQueryServiceConfig().GetHostnamePatterns(); + ExternalSourceFactory = NExternalSource::CreateExternalSourceFactory(std::vector(hostnamePatterns.begin(), hostnamePatterns.end())); + } + if (IsSchemeShardConfigured()) { StartStopCompactionQueues(); } diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.h b/ydb/core/tx/schemeshard/schemeshard_impl.h index 7e02338ab94d..e7f9c4e3150c 100644 --- a/ydb/core/tx/schemeshard/schemeshard_impl.h +++ b/ydb/core/tx/schemeshard/schemeshard_impl.h @@ -310,7 +310,7 @@ class TSchemeShard TActorId DelayedInitTenantDestination; TAutoPtr DelayedInitTenantReply; - NExternalSource::IExternalSourceFactory::TPtr ExternalSourceFactory; + NExternalSource::IExternalSourceFactory::TPtr ExternalSourceFactory{NExternalSource::CreateExternalSourceFactory({})}; THolder IgniteOperation(TProposeRequest& request, TOperationContext& context); THolder MakeDataShardProposal(const TPathId& pathId, const TOperationId& opId, diff --git a/ydb/core/viewer/json_describe.h b/ydb/core/viewer/json_describe.h index c5cedf7ae003..36a03a8daca4 100644 --- a/ydb/core/viewer/json_describe.h +++ b/ydb/core/viewer/json_describe.h @@ -268,7 +268,6 @@ class TJsonDescribe : public TViewerPipeClient { headers = HTTPFORBIDDENJSON; } TProtoToJson::ProtoToJson(json, *DescribeResult, JsonSettings); - DecodeExternalTableContent(json); } else { json << "null"; } @@ -277,41 +276,6 @@ class TJsonDescribe : public TViewerPipeClient { PassAway(); } - void DecodeExternalTableContent(TStringStream& json) const { - if (!DescribeResult) { - return; - } - - if (!DescribeResult->GetPathDescription().HasExternalTableDescription()) { - return; - } - - const auto& content = DescribeResult->GetPathDescription().GetExternalTableDescription().GetContent(); - if (!content) { - return; - } - - NJson::TJsonValue root; - const auto& sourceType = DescribeResult->GetPathDescription().GetExternalTableDescription().GetSourceType(); - try { - NJson::ReadJsonTree(json.Str(), &root); - root["PathDescription"]["ExternalTableDescription"].EraseValue("Content"); - auto source = AppData()->ExternalSourceFactory->GetOrCreate(sourceType); - auto parameters = source->GetParameters(content); - for (const auto& [key, items]: parameters) { - NJson::TJsonValue array{NJson::EJsonValueType::JSON_ARRAY}; - for (const auto& item: items) { - array.AppendValue(item); - } - root["PathDescription"]["ExternalTableDescription"]["Content"][key] = array; - } - } catch (...) { - BLOG_CRIT("Сan't unpack content for external table: " << sourceType << ", error: " << CurrentExceptionMessage()); - } - json.Clear(); - json << root; - } - void HandleTimeout() { Send(Event->Sender, new NMon::TEvHttpInfoRes(Viewer->GetHTTPGATEWAYTIMEOUT(Event->Get()), 0, NMon::IEvHttpInfoRes::EContentType::Custom)); PassAway();