|
13 | 13 | #include <ydb/library/yql/providers/yt/lib/config_clusters/config_clusters.h>
|
14 | 14 | #include <ydb/library/yql/providers/dq/local_gateway/yql_dq_gateway_local.h>
|
15 | 15 |
|
| 16 | +#include <ydb/library/yql/public/udf/udf_static_registry.h> |
| 17 | + |
16 | 18 | #include <ydb/library/yql/utils/log/proto/logger_config.pb.h>
|
17 | 19 | #include <ydb/library/yql/core/url_preprocessing/url_preprocessing.h>
|
18 | 20 | #include <ydb/library/yql/utils/actor_system/manager.h>
|
@@ -465,6 +467,7 @@ int RunMain(int argc, const char* argv[])
|
465 | 467 | TString fileStorageCfg;
|
466 | 468 | TVector<TString> udfsPaths;
|
467 | 469 | TString udfsDir;
|
| 470 | + bool excludeLinkedUdfs = false; |
468 | 471 | TMaybe<TString> dqHost;
|
469 | 472 | TMaybe<int> dqPort;
|
470 | 473 | int threads = 16;
|
@@ -548,6 +551,11 @@ int RunMain(int argc, const char* argv[])
|
548 | 551 | opts.AddLongOption("udfs-dir", "Load all shared libraries with UDFs found"
|
549 | 552 | " in given directory")
|
550 | 553 | .StoreResult(&udfsDir);
|
| 554 | + opts.AddLongOption("exclude-linked-udfs", "Exclude linked udfs when same udf passed from -u or --udfs-dir") |
| 555 | + .Optional() |
| 556 | + .NoArgument() |
| 557 | + .DefaultValue(excludeLinkedUdfs) |
| 558 | + .SetFlag(&excludeLinkedUdfs); |
551 | 559 | opts.AddLongOption("validate", "validate expression")
|
552 | 560 | .Optional()
|
553 | 561 | .NoArgument()
|
@@ -797,7 +805,16 @@ int RunMain(int argc, const char* argv[])
|
797 | 805 |
|
798 | 806 | NMiniKQL::FindUdfsInDir(udfsDir, &udfsPaths);
|
799 | 807 | auto funcRegistry = NMiniKQL::CreateFunctionRegistry(&NYql::NBacktrace::KikimrBackTrace, NMiniKQL::CreateBuiltinRegistry(), false, udfsPaths)->Clone();
|
800 |
| - NKikimr::NMiniKQL::FillStaticModules(*funcRegistry); |
| 808 | + if (excludeLinkedUdfs) { |
| 809 | + for (const auto& wrapper : NYql::NUdf::GetStaticUdfModuleWrapperList()) { |
| 810 | + auto [name, ptr] = wrapper(); |
| 811 | + if (!funcRegistry->IsLoadedUdfModule(name)) { |
| 812 | + funcRegistry->AddModule(TString(NKikimr::NMiniKQL::StaticModulePrefix) + name, name, std::move(ptr)); |
| 813 | + } |
| 814 | + } |
| 815 | + } else { |
| 816 | + NKikimr::NMiniKQL::FillStaticModules(*funcRegistry); |
| 817 | + } |
801 | 818 |
|
802 | 819 | TGatewaysConfig gatewaysConfig;
|
803 | 820 | ReadGatewaysConfig(gatewaysCfgFile, &gatewaysConfig, sqlFlags);
|
|
0 commit comments