diff options
author | vvvv <vvvv@ydb.tech> | 2023-07-25 20:43:43 +0300 |
---|---|---|
committer | root <root@qavm-2ed34686.qemu> | 2023-07-25 20:43:43 +0300 |
commit | 9f6bdb987285d67abf3184e0b6443adcc25bf32c (patch) | |
tree | 7e851113c3f60edfa85df4d85143fd79ae59ad3b | |
parent | 4201699ddd835c304f1196cc470aaef6c899328a (diff) | |
download | ydb-9f6bdb987285d67abf3184e0b6443adcc25bf32c.tar.gz |
Get rid of explicit PG kernel registration
10 files changed, 5 insertions, 32 deletions
diff --git a/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.darwin-x86_64.txt b/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.darwin-x86_64.txt index 6eeb196d39..751b744122 100644 --- a/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.darwin-x86_64.txt +++ b/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.darwin-x86_64.txt @@ -27,7 +27,6 @@ target_link_libraries(minikql-invoke_builtins-llvm PUBLIC ydb-library-binary_json library-yql-minikql yql-minikql-arrow - parser-pg_wrapper-interface yql-public-udf libs-apache-arrow ) diff --git a/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.linux-aarch64.txt b/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.linux-aarch64.txt index de733bbfc5..7f52dde17d 100644 --- a/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.linux-aarch64.txt +++ b/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.linux-aarch64.txt @@ -28,7 +28,6 @@ target_link_libraries(minikql-invoke_builtins-llvm PUBLIC ydb-library-binary_json library-yql-minikql yql-minikql-arrow - parser-pg_wrapper-interface yql-public-udf libs-apache-arrow ) diff --git a/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.linux-x86_64.txt b/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.linux-x86_64.txt index de733bbfc5..7f52dde17d 100644 --- a/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.linux-x86_64.txt +++ b/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.linux-x86_64.txt @@ -28,7 +28,6 @@ target_link_libraries(minikql-invoke_builtins-llvm PUBLIC ydb-library-binary_json library-yql-minikql yql-minikql-arrow - parser-pg_wrapper-interface yql-public-udf libs-apache-arrow ) diff --git a/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.windows-x86_64.txt b/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.windows-x86_64.txt index 6eeb196d39..751b744122 100644 --- a/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.windows-x86_64.txt +++ b/ydb/library/yql/minikql/invoke_builtins/llvm/CMakeLists.windows-x86_64.txt @@ -27,7 +27,6 @@ target_link_libraries(minikql-invoke_builtins-llvm PUBLIC ydb-library-binary_json library-yql-minikql yql-minikql-arrow - parser-pg_wrapper-interface yql-public-udf libs-apache-arrow ) diff --git a/ydb/library/yql/minikql/invoke_builtins/mkql_builtins.cpp b/ydb/library/yql/minikql/invoke_builtins/mkql_builtins.cpp index ca5fc09f6c..8bca6fdc39 100644 --- a/ydb/library/yql/minikql/invoke_builtins/mkql_builtins.cpp +++ b/ydb/library/yql/minikql/invoke_builtins/mkql_builtins.cpp @@ -14,8 +14,6 @@ #include <arrow/compute/registry.h> #include <arrow/compute/registry_internal.h> -#include <ydb/library/yql/parser/pg_wrapper/interface/utils.h> - namespace NKikimr { namespace NMiniKQL { @@ -241,7 +239,6 @@ private: TBuiltinFunctionRegistry::TBuiltinFunctionRegistry() { RegisterDefaultOperations(*this, KernelFamilyMap); - NYql::RegisterPgKernels(); CalculateMetadataEtag(); } diff --git a/ydb/library/yql/minikql/invoke_builtins/ya.make.inc b/ydb/library/yql/minikql/invoke_builtins/ya.make.inc index 49311e6ef8..c03be1e5ce 100644 --- a/ydb/library/yql/minikql/invoke_builtins/ya.make.inc +++ b/ydb/library/yql/minikql/invoke_builtins/ya.make.inc @@ -49,7 +49,6 @@ PEERDIR( ydb/library/binary_json ydb/library/yql/minikql ydb/library/yql/minikql/arrow - ydb/library/yql/parser/pg_wrapper/interface ydb/library/yql/public/udf contrib/libs/apache/arrow ) diff --git a/ydb/library/yql/parser/pg_wrapper/arrow.cpp b/ydb/library/yql/parser/pg_wrapper/arrow.cpp index c3eaeed6df..528c10b296 100644 --- a/ydb/library/yql/parser/pg_wrapper/arrow.cpp +++ b/ydb/library/yql/parser/pg_wrapper/arrow.cpp @@ -26,6 +26,7 @@ struct TExecs { return *Singleton<TExecs>(); } + TExecs(); THashMap<Oid, TExecFunc> Table; }; @@ -39,33 +40,18 @@ TExecFunc FindExec(Oid oid) { return it->second; } -void RegisterExec(Oid oid, TExecFunc func) { - auto& table = TExecs::Instance().Table; - table[oid] = func; -} - bool HasPgKernel(ui32 procOid) { return FindExec(procOid) != nullptr; } -namespace { - TAtomicCounter Initialized = 0; - TMutex InitializationLock; -} - -void RegisterPgKernels() { - if (Initialized.Val()) { - return; - } - TGuard<TMutex> g(InitializationLock); - if (Initialized.Val()) { - return; - } +TExecs::TExecs() +{ +#define RegisterExec(oid, func) Table[oid] = func #include "pg_kernels_register.0.inc" #include "pg_kernels_register.1.inc" #include "pg_kernels_register.2.inc" #include "pg_kernels_register.3.inc" - Initialized = 1; +#undef RegisterExec } const NPg::TAggregateDesc& ResolveAggregation(const TString& name, NKikimr::NMiniKQL::TTupleType* tupleType, const std::vector<ui32>& argsColumns, NKikimr::NMiniKQL::TType* returnType) { diff --git a/ydb/library/yql/parser/pg_wrapper/arrow.h b/ydb/library/yql/parser/pg_wrapper/arrow.h index 9389252d44..6686daec42 100644 --- a/ydb/library/yql/parser/pg_wrapper/arrow.h +++ b/ydb/library/yql/parser/pg_wrapper/arrow.h @@ -1279,7 +1279,6 @@ private: #endif TExecFunc FindExec(Oid oid); -void RegisterExec(Oid oid, TExecFunc func); const NPg::TAggregateDesc& ResolveAggregation(const TString& name, NKikimr::NMiniKQL::TTupleType* tupleType, const std::vector<ui32>& argsColumns, NKikimr::NMiniKQL::TType* returnType); diff --git a/ydb/library/yql/parser/pg_wrapper/interface/utils.h b/ydb/library/yql/parser/pg_wrapper/interface/utils.h index 8268fecc06..14b0039d44 100644 --- a/ydb/library/yql/parser/pg_wrapper/interface/utils.h +++ b/ydb/library/yql/parser/pg_wrapper/interface/utils.h @@ -14,6 +14,5 @@ bool ParsePgIntervalModifier(const TString& str, i32& ret); std::unique_ptr<NUdf::IPgBuilder> CreatePgBuilder(); bool HasPgKernel(ui32 procOid); -void RegisterPgKernels(); } // NYql diff --git a/ydb/library/yql/sql/pg_dummy/pg_sql_dummy.cpp b/ydb/library/yql/sql/pg_dummy/pg_sql_dummy.cpp index 228adea359..c38b3d7379 100644 --- a/ydb/library/yql/sql/pg_dummy/pg_sql_dummy.cpp +++ b/ydb/library/yql/sql/pg_dummy/pg_sql_dummy.cpp @@ -343,9 +343,6 @@ bool HasPgKernel(ui32 procOid) { return false; } -void RegisterPgKernels() { -} - std::function<NKikimr::NMiniKQL::IComputationNode* (NKikimr::NMiniKQL::TCallable&, const NKikimr::NMiniKQL::TComputationNodeFactoryContext&)> GetPgFactory() { |