aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhrustyashko <hrustyashko@yandex-team.ru>2022-04-07 10:47:49 +0300
committerhrustyashko <hrustyashko@yandex-team.ru>2022-04-07 10:47:49 +0300
commit18dcbc27f5d6c6d5a79cc85d30587dc2f14485cd (patch)
tree2f5f0cadb5822f8c712e961b0933722157f7e51e
parentfcb0844ab2c3ff96971288ec2d7b024051eb1658 (diff)
downloadydb-18dcbc27f5d6c6d5a79cc85d30587dc2f14485cd.tar.gz
YQ-1003 ExternalFunction provider
store connection name at resolved function rename expr nodes to dq_function dq function data provider ref:23fa1160965eb31574ae1c31a5a9152781f238c2
-rw-r--r--CMakeLists.darwin.txt16
-rw-r--r--CMakeLists.linux.txt15
-rw-r--r--contrib/libs/expat/CMakeLists.linux.txt22
-rw-r--r--contrib/libs/expat/CMakeLists.txt17
-rw-r--r--contrib/libs/sqlite3/CMakeLists.txt42
-rw-r--r--contrib/libs/xz/common/CMakeLists.txt24
-rw-r--r--contrib/libs/xz/liblzma/CMakeLists.txt108
-rw-r--r--contrib/restricted/libffi/CMakeLists.darwin.txt38
-rw-r--r--contrib/restricted/libffi/CMakeLists.linux.txt38
-rw-r--r--contrib/restricted/libffi/CMakeLists.txt13
-rw-r--r--contrib/tools/python3/lib/CMakeLists.txt21
-rw-r--r--contrib/tools/python3/src/CMakeLists.darwin.txt163
-rw-r--r--contrib/tools/python3/src/CMakeLists.linux.txt157
-rw-r--r--contrib/tools/python3/src/CMakeLists.txt13
-rw-r--r--contrib/tools/python3/src/Modules/CMakeLists.darwin.txt137
-rw-r--r--contrib/tools/python3/src/Modules/CMakeLists.linux.txt136
-rw-r--r--contrib/tools/python3/src/Modules/CMakeLists.txt13
-rw-r--r--contrib/tools/python3/src/Modules/_sqlite/CMakeLists.txt34
-rw-r--r--library/python/symbols/libc/CMakeLists.txt28
-rw-r--r--library/python/symbols/python/CMakeLists.txt25
-rw-r--r--library/python/symbols/registry/CMakeLists.txt17
-rw-r--r--ydb/library/yql/providers/common/provider/yql_provider_names.h5
-rw-r--r--ydb/library/yql/providers/external_function/cloud_function/gateway/CMakeLists.txt1
-rw-r--r--ydb/library/yql/providers/external_function/cloud_function/gateway/cloud_function_gateway.cpp47
-rw-r--r--ydb/library/yql/providers/external_function/cloud_function/gateway/cloud_function_gateway.h27
-rw-r--r--ydb/library/yql/providers/external_function/common/CMakeLists.txt20
-rw-r--r--ydb/library/yql/providers/external_function/common/dq_function_types.cpp20
-rw-r--r--ydb/library/yql/providers/external_function/common/dq_function_types.h56
-rw-r--r--ydb/library/yql/providers/external_function/expr_nodes/CMakeLists.txt69
-rw-r--r--ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.cpp4
-rw-r--r--ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.h40
-rw-r--r--ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.json21
-rw-r--r--ydb/library/yql/providers/external_function/gateway/CMakeLists.txt23
-rw-r--r--ydb/library/yql/providers/external_function/gateway/dq_function_gateway.cpp27
-rw-r--r--ydb/library/yql/providers/external_function/gateway/dq_function_gateway.h42
-rw-r--r--ydb/library/yql/providers/external_function/provider/CMakeLists.txt30
-rw-r--r--ydb/library/yql/providers/external_function/provider/dq_function_datasource.cpp70
-rw-r--r--ydb/library/yql/providers/external_function/provider/dq_function_intent_transformer.cpp44
-rw-r--r--ydb/library/yql/providers/external_function/provider/dq_function_load_meta.cpp94
-rw-r--r--ydb/library/yql/providers/external_function/provider/dq_function_provider.cpp49
-rw-r--r--ydb/library/yql/providers/external_function/provider/dq_function_provider.h35
-rw-r--r--ydb/library/yql/providers/external_function/provider/dq_function_provider_impl.h13
42 files changed, 1761 insertions, 53 deletions
diff --git a/CMakeLists.darwin.txt b/CMakeLists.darwin.txt
index 59df4cb4ff..c185f3bf02 100644
--- a/CMakeLists.darwin.txt
+++ b/CMakeLists.darwin.txt
@@ -1200,6 +1200,22 @@ add_subdirectory(ydb/library/yql/dq/state/ut)
add_subdirectory(ydb/library/yql/parser/pg_catalog/ut)
add_subdirectory(ydb/library/yql/providers/common/schema)
add_subdirectory(ydb/library/yql/providers/common/schema/skiff)
+add_subdirectory(ydb/library/yql/providers/external_function/provider)
+add_subdirectory(ydb/library/yql/providers/external_function/expr_nodes)
+add_subdirectory(contrib/tools/python3/src)
+add_subdirectory(contrib/tools/python3/src/Modules)
+add_subdirectory(contrib/libs/expat)
+add_subdirectory(contrib/libs/xz/liblzma)
+add_subdirectory(contrib/libs/xz/common)
+add_subdirectory(contrib/restricted/libffi)
+add_subdirectory(library/python/symbols/libc)
+add_subdirectory(library/python/symbols/registry)
+add_subdirectory(library/python/symbols/python)
+add_subdirectory(contrib/tools/python3/lib)
+add_subdirectory(contrib/tools/python3/src/Modules/_sqlite)
+add_subdirectory(contrib/libs/sqlite3)
+add_subdirectory(ydb/library/yql/providers/external_function/common)
+add_subdirectory(ydb/library/yql/providers/external_function/gateway)
add_subdirectory(ydb/library/yql/public/decimal/ut)
add_subdirectory(ydb/library/yql/public/issue/ut)
add_subdirectory(ydb/library/yql/public/udf/ut)
diff --git a/CMakeLists.linux.txt b/CMakeLists.linux.txt
index a2a907626d..f9134b30db 100644
--- a/CMakeLists.linux.txt
+++ b/CMakeLists.linux.txt
@@ -1295,6 +1295,21 @@ add_subdirectory(ydb/library/yql/dq/state/ut)
add_subdirectory(ydb/library/yql/parser/pg_catalog/ut)
add_subdirectory(ydb/library/yql/providers/common/schema)
add_subdirectory(ydb/library/yql/providers/common/schema/skiff)
+add_subdirectory(ydb/library/yql/providers/external_function/provider)
+add_subdirectory(ydb/library/yql/providers/external_function/expr_nodes)
+add_subdirectory(contrib/tools/python3/src)
+add_subdirectory(contrib/tools/python3/src/Modules)
+add_subdirectory(contrib/libs/xz/liblzma)
+add_subdirectory(contrib/libs/xz/common)
+add_subdirectory(contrib/restricted/libffi)
+add_subdirectory(library/python/symbols/libc)
+add_subdirectory(library/python/symbols/registry)
+add_subdirectory(library/python/symbols/python)
+add_subdirectory(contrib/tools/python3/lib)
+add_subdirectory(contrib/tools/python3/src/Modules/_sqlite)
+add_subdirectory(contrib/libs/sqlite3)
+add_subdirectory(ydb/library/yql/providers/external_function/common)
+add_subdirectory(ydb/library/yql/providers/external_function/gateway)
add_subdirectory(ydb/library/yql/public/decimal/ut)
add_subdirectory(ydb/library/yql/public/issue/ut)
add_subdirectory(ydb/library/yql/public/udf/ut)
diff --git a/contrib/libs/expat/CMakeLists.linux.txt b/contrib/libs/expat/CMakeLists.linux.txt
deleted file mode 100644
index 242054b589..0000000000
--- a/contrib/libs/expat/CMakeLists.linux.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# This file was gererated by the build system used internally in the Yandex monorepo.
-# Only simple modifications are allowed (adding source-files to targets, adding simple properties
-# like target_include_directories). These modifications will be ported to original
-# ya.make files by maintainers. Any complex modifications which can't be ported back to the
-# original buildsystem will not be accepted.
-
-
-
-add_library(contrib-libs-expat)
-target_compile_options(contrib-libs-expat PRIVATE
- -DHAVE_EXPAT_CONFIG_H
-)
-target_include_directories(contrib-libs-expat PRIVATE
- ${CMAKE_SOURCE_DIR}/contrib/libs/expat
- ${CMAKE_SOURCE_DIR}/contrib/libs/expat/lib
-)
-target_sources(contrib-libs-expat PRIVATE
- ${CMAKE_SOURCE_DIR}/contrib/libs/expat/lib/xmlparse.c
- ${CMAKE_SOURCE_DIR}/contrib/libs/expat/lib/xmlrole.c
- ${CMAKE_SOURCE_DIR}/contrib/libs/expat/lib/xmltok.c
-)
diff --git a/contrib/libs/expat/CMakeLists.txt b/contrib/libs/expat/CMakeLists.txt
index c031ddb850..242054b589 100644
--- a/contrib/libs/expat/CMakeLists.txt
+++ b/contrib/libs/expat/CMakeLists.txt
@@ -6,6 +6,17 @@
# original buildsystem will not be accepted.
-if (UNIX)
- include(CMakeLists.linux.txt)
-endif()
+
+add_library(contrib-libs-expat)
+target_compile_options(contrib-libs-expat PRIVATE
+ -DHAVE_EXPAT_CONFIG_H
+)
+target_include_directories(contrib-libs-expat PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/expat
+ ${CMAKE_SOURCE_DIR}/contrib/libs/expat/lib
+)
+target_sources(contrib-libs-expat PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/expat/lib/xmlparse.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/expat/lib/xmlrole.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/expat/lib/xmltok.c
+)
diff --git a/contrib/libs/sqlite3/CMakeLists.txt b/contrib/libs/sqlite3/CMakeLists.txt
new file mode 100644
index 0000000000..7a5a1ce6c1
--- /dev/null
+++ b/contrib/libs/sqlite3/CMakeLists.txt
@@ -0,0 +1,42 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(contrib-libs-sqlite3)
+target_compile_options(contrib-libs-sqlite3 PRIVATE
+ -DBUILD_sqlite
+ -DHAVE_USLEEP
+ -DSQLITE_ENABLE_COLUMN_METADATA
+ -DSQLITE_ENABLE_DBSTAT_VTAB
+ -DSQLITE_ENABLE_FTS3
+ -DSQLITE_ENABLE_FTS3_PARENTHESIS
+ -DSQLITE_ENABLE_FTS3_TOKENIZER
+ -DSQLITE_ENABLE_FTS4
+ -DSQLITE_ENABLE_FTS5
+ -DSQLITE_ENABLE_JSON1
+ -DSQLITE_ENABLE_MATH_FUNCTIONS
+ -DSQLITE_ENABLE_RTREE
+ -DSQLITE_ENABLE_STMT_SCANSTATUS
+ -DSQLITE_ENABLE_UNLOCK_NOTIFY
+ -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
+ -DSQLITE_HAVE_ZLIB=1
+ -DSQLITE_MAX_EXPR_DEPTH=10000
+ -DSQLITE_MAX_VARIABLE_NUMBER=250000
+ -DSQLITE_SECURE_DELETE
+ -DSQLITE_SOUNDEX
+ -DSQLITE_TEMP_STORE=1
+ -DSQLITE_THREADSAFE=1
+ -DSQLITE_OS_UNIX
+)
+target_include_directories(contrib-libs-sqlite3 PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/sqlite3
+)
+target_sources(contrib-libs-sqlite3 PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/sqlite3/sqlite3.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/sqlite3/test_multiplex.c
+)
diff --git a/contrib/libs/xz/common/CMakeLists.txt b/contrib/libs/xz/common/CMakeLists.txt
new file mode 100644
index 0000000000..a9f5098f6d
--- /dev/null
+++ b/contrib/libs/xz/common/CMakeLists.txt
@@ -0,0 +1,24 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(libs-xz-common)
+target_compile_options(libs-xz-common PRIVATE
+ -DTUKLIB_SYMBOL_PREFIX=lzma_
+)
+target_include_directories(libs-xz-common PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/common
+)
+target_link_libraries(libs-xz-common PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+)
+target_sources(libs-xz-common PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/common/tuklib_cpucores.c
+)
diff --git a/contrib/libs/xz/liblzma/CMakeLists.txt b/contrib/libs/xz/liblzma/CMakeLists.txt
new file mode 100644
index 0000000000..3926ba1729
--- /dev/null
+++ b/contrib/libs/xz/liblzma/CMakeLists.txt
@@ -0,0 +1,108 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(libs-xz-liblzma)
+target_compile_options(libs-xz-liblzma PUBLIC
+ -DLZMA_API_STATIC
+)
+target_compile_options(libs-xz-liblzma PRIVATE
+ -DHAVE_CONFIG_H
+ -DTUKLIB_SYMBOL_PREFIX=lzma_
+)
+target_include_directories(libs-xz-liblzma PUBLIC
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/api
+)
+target_include_directories(libs-xz-liblzma PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/api
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/check
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/delta
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lz
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lzma
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/rangecoder
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/simple
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/common
+)
+target_link_libraries(libs-xz-liblzma PUBLIC
+ contrib-libs-cxxsupp
+ libs-xz-common
+)
+target_sources(libs-xz-liblzma PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/check/check.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/check/crc32_fast.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/check/crc32_table.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/check/crc64_fast.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/check/crc64_table.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/check/sha256.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/alone_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/alone_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/auto_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/block_buffer_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/block_buffer_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/block_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/block_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/block_header_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/block_header_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/block_util.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/common.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/easy_buffer_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/easy_decoder_memusage.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/easy_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/easy_encoder_memusage.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/easy_preset.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/filter_buffer_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/filter_buffer_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/filter_common.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/filter_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/filter_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/filter_flags_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/filter_flags_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/hardware_cputhreads.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/index.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/index_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/index_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/index_hash.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/outqueue.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/stream_buffer_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/stream_buffer_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/stream_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/stream_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/stream_encoder_mt.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/stream_flags_common.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/stream_flags_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/stream_flags_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/vli_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/vli_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/common/vli_size.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/delta/delta_common.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/delta/delta_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/delta/delta_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lz/lz_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lz/lz_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lz/lz_encoder_mf.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lzma/fastpos_table.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lzma/lzma2_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lzma/lzma2_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lzma/lzma_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lzma/lzma_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lzma/lzma_encoder_optimum_fast.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lzma/lzma_encoder_optimum_normal.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/lzma/lzma_encoder_presets.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/rangecoder/price_table.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/simple/arm.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/simple/armthumb.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/simple/ia64.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/simple/powerpc.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/simple/simple_coder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/simple/simple_decoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/simple/simple_encoder.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/simple/sparc.c
+ ${CMAKE_SOURCE_DIR}/contrib/libs/xz/liblzma/simple/x86.c
+)
diff --git a/contrib/restricted/libffi/CMakeLists.darwin.txt b/contrib/restricted/libffi/CMakeLists.darwin.txt
new file mode 100644
index 0000000000..09883b16d1
--- /dev/null
+++ b/contrib/restricted/libffi/CMakeLists.darwin.txt
@@ -0,0 +1,38 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(contrib-restricted-libffi)
+target_compile_options(contrib-restricted-libffi PUBLIC
+ -DFFI_BUILDING
+)
+target_compile_options(contrib-restricted-libffi PRIVATE
+ -DHAVE_CONFIG_H
+)
+target_include_directories(contrib-restricted-libffi PUBLIC
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/include
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/configs/x86_64-apple-macosx/include
+)
+target_include_directories(contrib-restricted-libffi PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/include
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/configs/x86_64-apple-macosx
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/configs/x86_64-apple-macosx/include
+)
+target_sources(contrib-restricted-libffi PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/closures.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/java_raw_api.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/prep_cif.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/raw_api.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/types.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/x86/ffi64.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/x86/ffiw64.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/x86/unix64.S
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/x86/win64.S
+)
diff --git a/contrib/restricted/libffi/CMakeLists.linux.txt b/contrib/restricted/libffi/CMakeLists.linux.txt
new file mode 100644
index 0000000000..838df7bbc8
--- /dev/null
+++ b/contrib/restricted/libffi/CMakeLists.linux.txt
@@ -0,0 +1,38 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(contrib-restricted-libffi)
+target_compile_options(contrib-restricted-libffi PUBLIC
+ -DFFI_BUILDING
+)
+target_compile_options(contrib-restricted-libffi PRIVATE
+ -DHAVE_CONFIG_H
+)
+target_include_directories(contrib-restricted-libffi PUBLIC
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/include
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/configs/x86_64-pc-linux-gnu/include
+)
+target_include_directories(contrib-restricted-libffi PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/include
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/configs/x86_64-pc-linux-gnu
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/configs/x86_64-pc-linux-gnu/include
+)
+target_sources(contrib-restricted-libffi PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/closures.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/java_raw_api.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/prep_cif.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/raw_api.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/types.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/x86/ffi64.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/x86/ffiw64.c
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/x86/unix64.S
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/src/x86/win64.S
+)
diff --git a/contrib/restricted/libffi/CMakeLists.txt b/contrib/restricted/libffi/CMakeLists.txt
new file mode 100644
index 0000000000..a681d385f3
--- /dev/null
+++ b/contrib/restricted/libffi/CMakeLists.txt
@@ -0,0 +1,13 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+if (APPLE)
+ include(CMakeLists.darwin.txt)
+elseif (UNIX)
+ include(CMakeLists.linux.txt)
+endif()
diff --git a/contrib/tools/python3/lib/CMakeLists.txt b/contrib/tools/python3/lib/CMakeLists.txt
new file mode 100644
index 0000000000..879b9caf41
--- /dev/null
+++ b/contrib/tools/python3/lib/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(tools-python3-lib INTERFACE)
+target_link_libraries(tools-python3-lib INTERFACE
+ contrib-libs-cxxsupp
+ yutil
+ tools-python3-src
+ contrib-libs-cxxsupp
+ yutil
+ certs
+ contrib-libs-cxxsupp
+ yutil
+ python3-src-Modules
+)
diff --git a/contrib/tools/python3/src/CMakeLists.darwin.txt b/contrib/tools/python3/src/CMakeLists.darwin.txt
new file mode 100644
index 0000000000..23cecd74f4
--- /dev/null
+++ b/contrib/tools/python3/src/CMakeLists.darwin.txt
@@ -0,0 +1,163 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(tools-python3-src)
+target_compile_options(tools-python3-src PRIVATE
+ -DPy_BUILD_CORE
+)
+target_include_directories(tools-python3-src PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Include
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Include/internal
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/PC
+)
+target_link_libraries(tools-python3-src PUBLIC
+ contrib-libs-cxxsupp
+ python3-src-Modules
+)
+target_link_options(tools-python3-src INTERFACE
+ -framework
+ CoreFoundation
+ -framework
+ SystemConfiguration
+)
+target_sources(tools-python3-src PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_functoolsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/_iomodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/bufferedio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/bytesio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/fileio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/iobase.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/stringio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/textio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/winconsoleio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_threadmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/config.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/gcmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/main.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/mmapmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/posixmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/signalmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/timemodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/abstract.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/accu.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/boolobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/bytearrayobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/bytes_methods.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/bytesobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/call.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/capsule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/cellobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/classobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/codeobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/complexobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/descrobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/dictobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/enumobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/exceptions.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/fileobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/floatobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/frameobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/funcobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/genericaliasobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/genobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/interpreteridobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/iterobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/listobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/longobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/memoryobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/methodobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/moduleobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/namespaceobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/object.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/obmalloc.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/odictobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/picklebufobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/rangeobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/setobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/sliceobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/structseq.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/tupleobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/typeobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/unicodectype.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/unicodeobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/weakrefobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/acceler.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/grammar1.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/listnode.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/myreadline.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/node.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/parser.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/parsetok.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/pegen/parse.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/pegen/parse_string.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/pegen/peg_api.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/pegen/pegen.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/token.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/tokenizer.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/Python-ast.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/_warnings.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/asdl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/ast.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/ast_opt.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/ast_unparse.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/bltinmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/bootstrap_hash.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/ceval.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/codecs.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/compile.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/context.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/dtoa.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/dynamic_annotations.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/errors.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/fileutils.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/formatter_unicode.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/frozen.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/frozenmain.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/future.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getargs.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getcompiler.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getcopyright.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getopt.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getplatform.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getversion.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/graminit.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/hamt.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/hashtable.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/import.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/importdl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/initconfig.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/marshal.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/modsupport.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/mysnprintf.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/mystrtoul.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pathconfig.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/peephole.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/preconfig.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pyarena.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pyctype.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pyfpe.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pyhash.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pylifecycle.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pymath.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pystate.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pystrcmp.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pystrhex.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pystrtod.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pythonrun.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pytime.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/structmember.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/symtable.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/sysmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/thread.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/traceback.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/getpath.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/dynload_shlib.c
+)
diff --git a/contrib/tools/python3/src/CMakeLists.linux.txt b/contrib/tools/python3/src/CMakeLists.linux.txt
new file mode 100644
index 0000000000..4ec036fbe1
--- /dev/null
+++ b/contrib/tools/python3/src/CMakeLists.linux.txt
@@ -0,0 +1,157 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(tools-python3-src)
+target_compile_options(tools-python3-src PRIVATE
+ -DPy_BUILD_CORE
+)
+target_include_directories(tools-python3-src PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Include
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Include/internal
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/PC
+)
+target_link_libraries(tools-python3-src PUBLIC
+ contrib-libs-cxxsupp
+ python3-src-Modules
+)
+target_sources(tools-python3-src PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_functoolsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/_iomodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/bufferedio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/bytesio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/fileio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/iobase.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/stringio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/textio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_io/winconsoleio.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_threadmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/config.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/gcmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/main.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/mmapmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/posixmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/signalmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/timemodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/abstract.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/accu.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/boolobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/bytearrayobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/bytes_methods.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/bytesobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/call.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/capsule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/cellobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/classobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/codeobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/complexobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/descrobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/dictobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/enumobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/exceptions.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/fileobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/floatobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/frameobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/funcobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/genericaliasobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/genobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/interpreteridobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/iterobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/listobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/longobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/memoryobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/methodobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/moduleobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/namespaceobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/object.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/obmalloc.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/odictobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/picklebufobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/rangeobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/setobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/sliceobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/structseq.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/tupleobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/typeobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/unicodectype.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/unicodeobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Objects/weakrefobject.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/acceler.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/grammar1.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/listnode.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/myreadline.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/node.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/parser.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/parsetok.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/pegen/parse.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/pegen/parse_string.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/pegen/peg_api.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/pegen/pegen.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/token.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Parser/tokenizer.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/Python-ast.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/_warnings.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/asdl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/ast.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/ast_opt.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/ast_unparse.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/bltinmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/bootstrap_hash.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/ceval.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/codecs.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/compile.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/context.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/dtoa.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/dynamic_annotations.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/errors.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/fileutils.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/formatter_unicode.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/frozen.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/frozenmain.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/future.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getargs.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getcompiler.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getcopyright.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getopt.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getplatform.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/getversion.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/graminit.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/hamt.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/hashtable.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/import.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/importdl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/initconfig.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/marshal.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/modsupport.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/mysnprintf.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/mystrtoul.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pathconfig.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/peephole.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/preconfig.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pyarena.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pyctype.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pyfpe.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pyhash.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pylifecycle.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pymath.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pystate.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pystrcmp.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pystrhex.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pystrtod.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pythonrun.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/pytime.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/structmember.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/symtable.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/sysmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/thread.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/traceback.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/getpath.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Python/dynload_shlib.c
+)
diff --git a/contrib/tools/python3/src/CMakeLists.txt b/contrib/tools/python3/src/CMakeLists.txt
new file mode 100644
index 0000000000..a681d385f3
--- /dev/null
+++ b/contrib/tools/python3/src/CMakeLists.txt
@@ -0,0 +1,13 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+if (APPLE)
+ include(CMakeLists.darwin.txt)
+elseif (UNIX)
+ include(CMakeLists.linux.txt)
+endif()
diff --git a/contrib/tools/python3/src/Modules/CMakeLists.darwin.txt b/contrib/tools/python3/src/Modules/CMakeLists.darwin.txt
new file mode 100644
index 0000000000..3e2d70ca0a
--- /dev/null
+++ b/contrib/tools/python3/src/Modules/CMakeLists.darwin.txt
@@ -0,0 +1,137 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+find_package(OpenSSL REQUIRED)
+find_package(ZLIB REQUIRED)
+
+add_library(python3-src-Modules)
+target_compile_options(python3-src-Modules PRIVATE
+ -DPy_BUILD_CORE_MODULE
+)
+target_include_directories(python3-src-Modules PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/expat
+ ${CMAKE_SOURCE_DIR}/contrib/libs/libbz2
+ ${CMAKE_SOURCE_DIR}/contrib/libs/openssl
+ ${CMAKE_SOURCE_DIR}/contrib/libs/zlib
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/include
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Include
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Include/internal
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/PC
+)
+target_link_libraries(python3-src-Modules PUBLIC
+ contrib-libs-expat
+ contrib-libs-libbz2
+ OpenSSL::OpenSSL
+ ZLIB::ZLIB
+ libs-xz-liblzma
+ contrib-restricted-libffi
+)
+target_sources(python3-src-Modules PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_abc.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_asynciomodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_bisectmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_blake2/blake2b_impl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_blake2/blake2module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_blake2/blake2s_impl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_bz2module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_codecsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_collectionsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_contextvarsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_csv.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ctypes/_ctypes.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ctypes/callbacks.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ctypes/callproc.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ctypes/cfield.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ctypes/stgdict.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_datetimemodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/_decimal.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/basearith.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/constants.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/context.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/convolute.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/crt.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/difradix2.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/fnt.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/fourstep.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/io.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpalloc.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/numbertheory.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/sixstep.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/transpose.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_elementtree.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_hashopenssl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_heapqmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_json.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_localemodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_lsprof.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_lzmamodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_math.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_multiprocessing/multiprocessing.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_multiprocessing/posixshmem.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_multiprocessing/semaphore.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_opcode.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_operator.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_peg_parser.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_pickle.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_queuemodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_randommodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sha3/sha3module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sre.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ssl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_stat.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_statisticsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_struct.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_tracemalloc.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_weakref.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_xxsubinterpretersmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_xxtestfuzz/_xxtestfuzz.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_xxtestfuzz/fuzzer.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_zoneinfo.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/arraymodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/atexitmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/audioop.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/binascii.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_cn.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_hk.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_jp.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_kr.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_tw.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/multibytecodec.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cmathmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/errnomodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/faulthandler.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/getbuildinfo.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/itertoolsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/mathmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/md5module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/parsermodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/pyexpat.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/rotatingtree.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/selectmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/sha1module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/sha256module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/sha512module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/socketmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/symtablemodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/unicodedata.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/zlibmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_cryptmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_posixsubprocess.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/fcntlmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/grpmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/pwdmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/resource.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/syslogmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/termios.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ctypes/darwin/dlfcn_simple.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_scproxy.c
+)
diff --git a/contrib/tools/python3/src/Modules/CMakeLists.linux.txt b/contrib/tools/python3/src/Modules/CMakeLists.linux.txt
new file mode 100644
index 0000000000..044d4878b5
--- /dev/null
+++ b/contrib/tools/python3/src/Modules/CMakeLists.linux.txt
@@ -0,0 +1,136 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+find_package(OpenSSL REQUIRED)
+find_package(ZLIB REQUIRED)
+
+add_library(python3-src-Modules)
+target_compile_options(python3-src-Modules PRIVATE
+ -DPy_BUILD_CORE_MODULE
+)
+target_include_directories(python3-src-Modules PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/expat
+ ${CMAKE_SOURCE_DIR}/contrib/libs/libbz2
+ ${CMAKE_SOURCE_DIR}/contrib/libs/openssl
+ ${CMAKE_SOURCE_DIR}/contrib/libs/zlib
+ ${CMAKE_SOURCE_DIR}/contrib/restricted/libffi/include
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Include
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Include/internal
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/PC
+)
+target_link_libraries(python3-src-Modules PUBLIC
+ contrib-libs-expat
+ contrib-libs-libbz2
+ OpenSSL::OpenSSL
+ ZLIB::ZLIB
+ libs-xz-liblzma
+ contrib-restricted-libffi
+)
+target_sources(python3-src-Modules PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_abc.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_asynciomodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_bisectmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_blake2/blake2b_impl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_blake2/blake2module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_blake2/blake2s_impl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_bz2module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_codecsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_collectionsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_contextvarsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_csv.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ctypes/_ctypes.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ctypes/callbacks.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ctypes/callproc.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ctypes/cfield.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ctypes/stgdict.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_datetimemodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/_decimal.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/basearith.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/constants.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/context.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/convolute.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/crt.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/difradix2.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/fnt.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/fourstep.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/io.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpalloc.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/mpdecimal.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/numbertheory.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/sixstep.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_decimal/libmpdec/transpose.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_elementtree.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_hashopenssl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_heapqmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_json.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_localemodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_lsprof.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_lzmamodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_math.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_multiprocessing/multiprocessing.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_multiprocessing/posixshmem.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_multiprocessing/semaphore.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_opcode.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_operator.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_peg_parser.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_pickle.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_queuemodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_randommodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sha3/sha3module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sre.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_ssl.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_stat.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_statisticsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_struct.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_tracemalloc.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_weakref.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_xxsubinterpretersmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_xxtestfuzz/_xxtestfuzz.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_xxtestfuzz/fuzzer.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_zoneinfo.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/arraymodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/atexitmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/audioop.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/binascii.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_cn.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_hk.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_iso2022.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_jp.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_kr.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/_codecs_tw.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cjkcodecs/multibytecodec.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/cmathmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/errnomodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/faulthandler.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/getbuildinfo.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/itertoolsmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/mathmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/md5module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/parsermodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/pyexpat.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/rotatingtree.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/selectmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/sha1module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/sha256module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/sha512module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/socketmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/symtablemodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/unicodedata.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/zlibmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_cryptmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_posixsubprocess.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/fcntlmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/grpmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/pwdmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/resource.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/syslogmodule.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/termios.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/spwdmodule.c
+)
diff --git a/contrib/tools/python3/src/Modules/CMakeLists.txt b/contrib/tools/python3/src/Modules/CMakeLists.txt
new file mode 100644
index 0000000000..a681d385f3
--- /dev/null
+++ b/contrib/tools/python3/src/Modules/CMakeLists.txt
@@ -0,0 +1,13 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+if (APPLE)
+ include(CMakeLists.darwin.txt)
+elseif (UNIX)
+ include(CMakeLists.linux.txt)
+endif()
diff --git a/contrib/tools/python3/src/Modules/_sqlite/CMakeLists.txt b/contrib/tools/python3/src/Modules/_sqlite/CMakeLists.txt
new file mode 100644
index 0000000000..eb51a0826b
--- /dev/null
+++ b/contrib/tools/python3/src/Modules/_sqlite/CMakeLists.txt
@@ -0,0 +1,34 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(src-Modules-_sqlite)
+target_compile_options(src-Modules-_sqlite PRIVATE
+ -DMODULE_NAME="sqlite3"
+)
+target_include_directories(src-Modules-_sqlite PUBLIC
+ ${CMAKE_SOURCE_DIR}/contrib/libs/python/Include
+)
+target_include_directories(src-Modules-_sqlite PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/libs/sqlite3
+ ${CMAKE_SOURCE_DIR}/contrib/libs/python/Include
+)
+target_link_libraries(src-Modules-_sqlite PUBLIC
+ contrib-libs-sqlite3
+)
+target_sources(src-Modules-_sqlite PRIVATE
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sqlite/cache.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sqlite/connection.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sqlite/cursor.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sqlite/microprotocols.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sqlite/module.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sqlite/prepare_protocol.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sqlite/row.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sqlite/statement.c
+ ${CMAKE_SOURCE_DIR}/contrib/tools/python3/src/Modules/_sqlite/util.c
+)
diff --git a/library/python/symbols/libc/CMakeLists.txt b/library/python/symbols/libc/CMakeLists.txt
new file mode 100644
index 0000000000..ef018b607f
--- /dev/null
+++ b/library/python/symbols/libc/CMakeLists.txt
@@ -0,0 +1,28 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(python-symbols-libc INTERFACE)
+target_link_libraries(python-symbols-libc INTERFACE
+ contrib-libs-cxxsupp
+ yutil
+ python-symbols-registry
+)
+
+add_global_library_for(python-symbols-libc.global python-symbols-libc)
+target_compile_options(python-symbols-libc.global PRIVATE
+ -Wno-deprecated-declarations
+)
+target_link_libraries(python-symbols-libc.global PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ python-symbols-registry
+)
+target_sources(python-symbols-libc.global PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/python/symbols/libc/syms.cpp
+)
diff --git a/library/python/symbols/python/CMakeLists.txt b/library/python/symbols/python/CMakeLists.txt
new file mode 100644
index 0000000000..3993e19c91
--- /dev/null
+++ b/library/python/symbols/python/CMakeLists.txt
@@ -0,0 +1,25 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(python-symbols-python INTERFACE)
+target_link_libraries(python-symbols-python INTERFACE
+ contrib-libs-cxxsupp
+ yutil
+ python-symbols-registry
+)
+
+add_global_library_for(python-symbols-python.global python-symbols-python)
+target_link_libraries(python-symbols-python.global PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ python-symbols-registry
+)
+target_sources(python-symbols-python.global PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/python/symbols/python/syms.cpp
+)
diff --git a/library/python/symbols/registry/CMakeLists.txt b/library/python/symbols/registry/CMakeLists.txt
new file mode 100644
index 0000000000..89e8f9ba17
--- /dev/null
+++ b/library/python/symbols/registry/CMakeLists.txt
@@ -0,0 +1,17 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(python-symbols-registry)
+target_link_libraries(python-symbols-registry PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+)
+target_sources(python-symbols-registry PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/python/symbols/registry/syms.cpp
+)
diff --git a/ydb/library/yql/providers/common/provider/yql_provider_names.h b/ydb/library/yql/providers/common/provider/yql_provider_names.h
index 7cf29b4c1d..03924fbb0b 100644
--- a/ydb/library/yql/providers/common/provider/yql_provider_names.h
+++ b/ydb/library/yql/providers/common/provider/yql_provider_names.h
@@ -17,11 +17,12 @@ constexpr TStringBuf ClickHouseProviderName = "clickhouse";
constexpr TStringBuf YdbProviderName = "ydb";
constexpr TStringBuf PqProviderName = "pq";
constexpr TStringBuf S3ProviderName = "s3";
+constexpr TStringBuf FunctionProviderName = "function";
-constexpr std::array<const TStringBuf, 11> Providers = {
+constexpr std::array<const TStringBuf, 12> Providers = {
{ConfigProviderName, YtProviderName, KikimrProviderName, RtmrProviderName, S3ProviderName,
StatProviderName, SolomonProviderName, DqProviderName, ClickHouseProviderName, YdbProviderName,
- PqProviderName}
+ PqProviderName, FunctionProviderName}
};
} // namespace NYql
diff --git a/ydb/library/yql/providers/external_function/cloud_function/gateway/CMakeLists.txt b/ydb/library/yql/providers/external_function/cloud_function/gateway/CMakeLists.txt
index 119bb0da5a..04a8ed0d4e 100644
--- a/ydb/library/yql/providers/external_function/cloud_function/gateway/CMakeLists.txt
+++ b/ydb/library/yql/providers/external_function/cloud_function/gateway/CMakeLists.txt
@@ -15,6 +15,7 @@ target_link_libraries(external_function-cloud_function-gateway PUBLIC
contrib-libs-cxxsupp
yutil
common-token_accessor-client
+ providers-external_function-gateway
client-ydb_types-credentials
cpp-string_utils-quote
cpp-threading-future
diff --git a/ydb/library/yql/providers/external_function/cloud_function/gateway/cloud_function_gateway.cpp b/ydb/library/yql/providers/external_function/cloud_function/gateway/cloud_function_gateway.cpp
index f784af39d9..9650ebf68a 100644
--- a/ydb/library/yql/providers/external_function/cloud_function/gateway/cloud_function_gateway.cpp
+++ b/ydb/library/yql/providers/external_function/cloud_function/gateway/cloud_function_gateway.cpp
@@ -9,6 +9,7 @@
#include <cloud/bitbucket/private-api/yandex/cloud/priv/serverless/functions/v1/function.pb.h>
#include <library/cpp/grpc/client/grpc_client_low.h>
+#include <google/protobuf/text_format.h>
#include <exception>
#include <fmt/format.h>
@@ -17,7 +18,7 @@ namespace NCloudFunction {
using namespace yandex::cloud::priv::serverless::functions::v1;
-class TCloudFunctionGateway : public ICloudFunctionGateway {
+class TCloudFunctionGateway : public IDqFunctionGateway {
public:
using TPtr = std::shared_ptr<TCloudFunctionGateway>;
@@ -27,8 +28,8 @@ private:
class TImpl : public std::enable_shared_from_this<TImpl> {
public:
TImpl(const TString& apiEndpoint, const TString& sslCaCert, NYdb::TCredentialsProviderPtr credentialsProvider)
- : Client(std::make_unique<NGrpc::TGRpcClientLow>())
- , CredentialsProvider(std::move(credentialsProvider))
+ : Client(std::make_unique<NGrpc::TGRpcClientLow>())
+ , CredentialsProvider(std::move(credentialsProvider))
{
NGrpc::TGRpcClientConfig grpcConf;
grpcConf.Locator = apiEndpoint;
@@ -74,20 +75,37 @@ private:
};
public:
- TCloudFunctionGateway(const TString& apiEndpoint, const TString& sslCaCert, NYdb::TCredentialsProviderPtr credentialsProvider)
- : Impl(std::make_shared<TImpl>(apiEndpoint, sslCaCert, credentialsProvider))
+ TCloudFunctionGateway(const TString& apiEndpoint, const TString& sslCaCert,
+ NYdb::TCredentialsProviderPtr credentialsProvider,
+ const TString& connectionName)
+ : Impl(std::make_shared<TImpl>(apiEndpoint, sslCaCert, credentialsProvider))
+ , ConnectionName(connectionName)
{
}
- NThreading::TFuture<Function> ResolveFunction(const TString& folderId, const TString& functionName) {
+ NThreading::TFuture<NDqFunction::TDqFunctionDescription> ResolveFunction(const TString& folderId, const TString& functionName) {
auto listResponse = Impl->List(folderId, functionName);
- return listResponse.Apply([folderId, functionName](const NThreading::TFuture<ListFunctionsResponse>& future) -> Function {
- auto functions = future.GetValue().Getfunctions();
- if (!functions.empty()) {
- return functions.at(0);
+ auto connectionName = ConnectionName;
+ return listResponse.Apply([folderId, functionName, connectionName]
+ (const NThreading::TFuture<ListFunctionsResponse>& future) -> NDqFunction::TDqFunctionDescription
+ {
+ auto functions = future.GetValue().Getfunctions();
+ if (!functions.empty()) {
+ auto protoFunction = functions.at(0);
+ const google::protobuf::EnumDescriptor* descriptor = Function::Status_descriptor();
+ TString status = descriptor->FindValueByNumber(protoFunction.Getstatus())->name();
+
+ return NDqFunction::TDqFunctionDescription{
+ .Type = TDqFunctionType{CloudFunctionProviderName},
+ .FunctionName = protoFunction.Getname(),
+ .Connection = connectionName,
+ .InvokeUrl = protoFunction.Gethttp_invoke_url(),
+ .Status = status
+ };
+ }
+ throw yexception() << fmt::format("Failed to find cloud function '{}' at folder '{}'", functionName, folderId);
}
- throw yexception() << fmt::format("Failed to find cloud function '{}' at folder '{}'", functionName, folderId);
- });
+ );
}
~TCloudFunctionGateway() {
@@ -96,9 +114,10 @@ public:
private:
std::shared_ptr<TImpl> Impl;
+ const TString ConnectionName;
};
-ICloudFunctionGateway::TPtr CreateCloudFunctionGateway(
+IDqFunctionGateway::TPtr CreateCloudFunctionGateway(
const TString& apiEndpoint, const TString& sslCaCert,
const THashMap<TString, TString>& secureParams, const TString& connectionName,
ISecuredServiceAccountCredentialsFactory::TPtr credentialsFactory) {
@@ -108,7 +127,7 @@ ICloudFunctionGateway::TPtr CreateCloudFunctionGateway(
throw yexception() << fmt::format("Can't find token by connection name '{}'", connectionName);
}
auto credProviderFactory = CreateCredentialsProviderFactoryForStructuredToken(credentialsFactory, token->second, true)->CreateProvider();
- return std::make_shared<TCloudFunctionGateway>(apiEndpoint, sslCaCert, credProviderFactory);
+ return std::make_shared<TCloudFunctionGateway>(apiEndpoint, sslCaCert, credProviderFactory, connectionName);
}
} // namespace NCloudFunction
diff --git a/ydb/library/yql/providers/external_function/cloud_function/gateway/cloud_function_gateway.h b/ydb/library/yql/providers/external_function/cloud_function/gateway/cloud_function_gateway.h
index 867a78b392..dbe528fa32 100644
--- a/ydb/library/yql/providers/external_function/cloud_function/gateway/cloud_function_gateway.h
+++ b/ydb/library/yql/providers/external_function/cloud_function/gateway/cloud_function_gateway.h
@@ -1,27 +1,30 @@
#pragma once
#include <ydb/library/yql/providers/common/token_accessor/client/factory.h>
+#include <ydb/library/yql/providers/external_function/gateway/dq_function_gateway.h>
#include <ydb/public/sdk/cpp/client/ydb_types/credentials/credentials.h>
-#include <library/cpp/threading/future/future.h>
-
-namespace yandex::cloud::priv::serverless::functions::v1 {
- class Function;
-}
namespace NYql::NDq {
namespace NCloudFunction {
-class ICloudFunctionGateway {
-public:
- using TPtr = std::shared_ptr<ICloudFunctionGateway>;
- virtual NThreading::TFuture<yandex::cloud::priv::serverless::functions::v1::Function> ResolveFunction(const TString& folderId, const TString& functionName) = 0;
- virtual ~ICloudFunctionGateway() = default;
-};
+constexpr TStringBuf CloudFunctionProviderName = "CloudFunction";
-ICloudFunctionGateway::TPtr CreateCloudFunctionGateway(
+IDqFunctionGateway::TPtr CreateCloudFunctionGateway(
const TString& apiEndpoint, const TString& sslCaCert,
const THashMap<TString, TString>& secureParams, const TString& connectionName,
ISecuredServiceAccountCredentialsFactory::TPtr credentialsFactory);
+void RegisterCloudFunctionGateway(TDqFunctionGatewayFactory& factory,
+ const TString& apiEndpoint, const TString& sslCaCert,
+ ISecuredServiceAccountCredentialsFactory::TPtr credentialsFactory) {
+
+ factory.Register(TString{CloudFunctionProviderName}, [apiEndpoint, sslCaCert, credentialsFactory]
+ (const THashMap<TString, TString>& secureParams, const TString& connectionName) {
+ return CreateCloudFunctionGateway(apiEndpoint, sslCaCert,
+ secureParams, connectionName,
+ credentialsFactory);
+ });
+}
+
}
} \ No newline at end of file
diff --git a/ydb/library/yql/providers/external_function/common/CMakeLists.txt b/ydb/library/yql/providers/external_function/common/CMakeLists.txt
new file mode 100644
index 0000000000..cf4fd061e4
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/common/CMakeLists.txt
@@ -0,0 +1,20 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(providers-external_function-common)
+target_compile_options(providers-external_function-common PRIVATE
+ -DUSE_CURRENT_UDF_ABI_VERSION
+)
+target_link_libraries(providers-external_function-common PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+)
+target_sources(providers-external_function-common PRIVATE
+ ${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/external_function/common/dq_function_types.cpp
+)
diff --git a/ydb/library/yql/providers/external_function/common/dq_function_types.cpp b/ydb/library/yql/providers/external_function/common/dq_function_types.cpp
new file mode 100644
index 0000000000..405a75d41f
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/common/dq_function_types.cpp
@@ -0,0 +1,20 @@
+#include "dq_function_types.h"
+
+namespace NYql::NDqFunction {
+
+TDqFunctionResolver::TDqFunctionResolver() {}
+
+TDqFunctionDescription TDqFunctionResolver::AddFunction(const TDqFunctionType& type, const TString& functionName, const TString& connection) {
+ auto function = TDqFunctionDescription{
+ .Type = type,
+ .FunctionName = functionName,
+ .Connection = connection
+ };
+ return *(FunctionsDescription.emplace(function).first);
+}
+
+std::vector<TDqFunctionDescription> TDqFunctionResolver::FunctionsToResolve() {
+ return {FunctionsDescription.begin(), FunctionsDescription.end()};
+}
+
+} \ No newline at end of file
diff --git a/ydb/library/yql/providers/external_function/common/dq_function_types.h b/ydb/library/yql/providers/external_function/common/dq_function_types.h
new file mode 100644
index 0000000000..7716f33613
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/common/dq_function_types.h
@@ -0,0 +1,56 @@
+#pragma once
+
+#include <util/generic/string.h>
+#include <util/generic/hash.h>
+#include <util/generic/hash_set.h>
+
+#include <vector>
+
+namespace NYql::NDqFunction {
+
+using TDqFunctionType = TString;
+
+struct TDqFunctionDescription {
+ TDqFunctionType Type;
+ TString FunctionName;
+ TString Connection;
+
+ TString InvokeUrl;
+ TString Status;
+};
+
+struct TDqFunctionDescriptionHash {
+ size_t operator()(const TDqFunctionDescription& key) const {
+ std::hash<TString> Hash;
+ auto initHash = CombineHashes(Hash(key.Type), Hash(key.FunctionName));
+ if (!key.Connection.empty()) {
+ initHash = CombineHashes(Hash(key.Connection), initHash);
+ }
+ return initHash;
+ }
+};
+
+struct TDqFunctionDescriptionEq {
+ bool operator()(const TDqFunctionDescription& a, const TDqFunctionDescription& b) const {
+ return a.Type == b.Type
+ && a.FunctionName == b.FunctionName
+ && a.Connection == b.Connection;
+ }
+};
+
+using TDqFunctionsSet = THashSet<TDqFunctionDescription, TDqFunctionDescriptionHash, TDqFunctionDescriptionEq>;
+
+class TDqFunctionResolver : public TThrRefBase {
+public:
+ using TPtr = TIntrusivePtr<TDqFunctionResolver>;
+
+ TDqFunctionResolver();
+
+ TDqFunctionDescription AddFunction(const TDqFunctionType& type, const TString& functionName, const TString& connection);
+ std::vector<TDqFunctionDescription> FunctionsToResolve();
+private:
+ TDqFunctionsSet FunctionsDescription;
+};
+
+
+} \ No newline at end of file
diff --git a/ydb/library/yql/providers/external_function/expr_nodes/CMakeLists.txt b/ydb/library/yql/providers/external_function/expr_nodes/CMakeLists.txt
new file mode 100644
index 0000000000..71b5d56f1c
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/expr_nodes/CMakeLists.txt
@@ -0,0 +1,69 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(providers-external_function-expr_nodes)
+target_link_libraries(providers-external_function-expr_nodes PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ yql-core-expr_nodes
+ contrib-libs-cxxsupp
+ yutil
+ contrib-libs-cxxsupp
+ yutil
+ contrib-libs-cxxsupp
+ yutil
+ tools-python3-src
+ contrib-libs-cxxsupp
+ yutil
+ python-symbols-libc
+ python-symbols-python
+ tools-python3-lib
+ contrib-libs-cxxsupp
+ yutil
+ tools-python3-src
+ library-cpp-resource
+ contrib-libs-cxxsupp
+ yutil
+ contrib-libs-cxxsupp
+ yutil
+ contrib-libs-cxxsupp
+ yutil
+ contrib-libs-cxxsupp
+ yutil
+ contrib-libs-cxxsupp
+ yutil
+ cpp-malloc-jemalloc
+ library-cpp-cpuid_check
+ src-Modules-_sqlite
+)
+target_sources(providers-external_function-expr_nodes PRIVATE
+ ${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.cpp
+ ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.gen.h
+ ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.decl.inl.h
+ ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.defs.inl.h
+ ${CMAKE_SOURCE_DIR}/library/python/symbols/module/module.cpp
+ ${CMAKE_SOURCE_DIR}/contrib/python/MarkupSafe/py3/markupsafe/_speedups.c
+)
+add_custom_command(
+ OUTPUT
+ ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.gen.h
+ ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.decl.inl.h
+ ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.defs.inl.h
+ DEPENDS
+ ${CMAKE_SOURCE_DIR}/ydb/library/yql/core/expr_nodes_gen/yql_expr_nodes_gen.jnj
+ ${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.json
+ ${CMAKE_BINARY_DIR}/ydb/library/yql/core/expr_nodes_gen/gen/gen
+ COMMAND
+ ${CMAKE_BINARY_DIR}/ydb/library/yql/core/expr_nodes_gen/gen/gen
+ ${CMAKE_SOURCE_DIR}/ydb/library/yql/core/expr_nodes_gen/yql_expr_nodes_gen.jnj
+ ${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.json
+ ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.gen.h
+ ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.decl.inl.h
+ ${CMAKE_BINARY_DIR}/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.defs.inl.h
+)
diff --git a/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.cpp b/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.cpp
new file mode 100644
index 0000000000..895120d52e
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.cpp
@@ -0,0 +1,4 @@
+#include "dq_function_expr_nodes.h"
+
+namespace NYql::NNodes {
+}
diff --git a/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.h b/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.h
new file mode 100644
index 0000000000..a9993ba665
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.h
@@ -0,0 +1,40 @@
+#pragma once
+
+#include <ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.gen.h>
+#include <ydb/library/yql/core/expr_nodes/yql_expr_nodes.h>
+#include <ydb/library/yql/providers/common/provider/yql_provider_names.h>
+
+namespace NYql {
+namespace NNodes {
+
+#include <ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.decl.inl.h>
+
+class TFunctionDataSource: public NGenerated::TFunctionDataSourceStub<TExprBase, TCallable, TCoAtom> {
+public:
+ explicit TFunctionDataSource(const TExprNode* node)
+ : TFunctionDataSourceStub(node)
+ {
+ }
+
+ explicit TFunctionDataSource(const TExprNode::TPtr& node)
+ : TFunctionDataSourceStub(node)
+ {
+ }
+
+ static bool Match(const TExprNode* node) {
+ if (!TFunctionDataSourceStub::Match(node)) {
+ return false;
+ }
+
+ if (node->Child(0)->Content() != FunctionProviderName) {
+ return false;
+ }
+
+ return true;
+ }
+};
+
+#include <ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.defs.inl.h>
+
+} // namespace NNodes
+} // namespace NYql
diff --git a/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.json b/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.json
new file mode 100644
index 0000000000..16084c8755
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.json
@@ -0,0 +1,21 @@
+{
+ "NodeRootType": "TExprBase",
+ "NodeBuilderBase": "TNodeBuilderBase",
+ "ListBuilderBase": "TListBuilderBase",
+ "FreeArgCallableBase": "TFreeArgCallable",
+ "FreeArgBuilderBase": "TFreeArgCallableBuilderBase",
+ "Nodes": [
+ {
+ "Name": "TFunctionDataSource",
+ "Base": "TCallable",
+ "Definition": "Custom",
+ "Match": {"Type": "Callable", "Name": "DataSource"},
+ "Children": [
+ {"Index": 0, "Name": "Category", "Type": "TCoAtom"},
+ {"Index": 1, "Name": "Type", "Type": "TCoAtom"},
+ {"Index": 2, "Name": "FunctionName", "Type": "TCoAtom"},
+ {"Index": 3, "Name": "Connection", "Type": "TCoAtom"}
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/ydb/library/yql/providers/external_function/gateway/CMakeLists.txt b/ydb/library/yql/providers/external_function/gateway/CMakeLists.txt
new file mode 100644
index 0000000000..7a707ccafd
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/gateway/CMakeLists.txt
@@ -0,0 +1,23 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(providers-external_function-gateway)
+target_compile_options(providers-external_function-gateway PRIVATE
+ -DUSE_CURRENT_UDF_ABI_VERSION
+)
+target_link_libraries(providers-external_function-gateway PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ common-token_accessor-client
+ providers-external_function-common
+ cpp-threading-future
+)
+target_sources(providers-external_function-gateway PRIVATE
+ ${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/external_function/gateway/dq_function_gateway.cpp
+)
diff --git a/ydb/library/yql/providers/external_function/gateway/dq_function_gateway.cpp b/ydb/library/yql/providers/external_function/gateway/dq_function_gateway.cpp
new file mode 100644
index 0000000000..518c0c9e40
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/gateway/dq_function_gateway.cpp
@@ -0,0 +1,27 @@
+#include "dq_function_gateway.h"
+
+#include <ydb/library/yql/utils/yql_panic.h>
+
+namespace NYql {
+
+void TDqFunctionGatewayFactory::Register(const TDqFunctionType& type, TGatewayCreator creator) {
+ auto [_, registered] = CreatorsByType.emplace(type, std::move(creator));
+ Y_VERIFY(registered);
+}
+
+bool TDqFunctionGatewayFactory::IsKnownFunctionType(const TDqFunctionType& type) {
+ return !type.empty() && CreatorsByType.contains(type);
+}
+
+IDqFunctionGateway::TPtr TDqFunctionGatewayFactory::CreateDqFunctionGateway(
+ const TDqFunctionType& type, const THashMap<TString, TString>& secureParams,
+ const TString& connection) const {
+
+ auto creator = CreatorsByType.find(type);
+ if (creator == CreatorsByType.end()) {
+ YQL_ENSURE(false, "Unregistered external function gateway type " << type);
+ }
+ return (creator->second)(secureParams, connection);
+}
+
+} \ No newline at end of file
diff --git a/ydb/library/yql/providers/external_function/gateway/dq_function_gateway.h b/ydb/library/yql/providers/external_function/gateway/dq_function_gateway.h
new file mode 100644
index 0000000000..dd460c26ce
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/gateway/dq_function_gateway.h
@@ -0,0 +1,42 @@
+#pragma once
+
+#include <ydb/library/yql/providers/common/token_accessor/client/factory.h>
+#include <ydb/library/yql/providers/external_function/common/dq_function_types.h>
+#include <library/cpp/threading/future/future.h>
+
+#include <unordered_map>
+
+namespace NYql {
+
+using namespace NDqFunction;
+
+class IDqFunctionGateway {
+public:
+ using TPtr = std::shared_ptr<IDqFunctionGateway>;
+
+ virtual NThreading::TFuture<TDqFunctionDescription> ResolveFunction(const TString& folderId, const TString& functionName);
+ virtual ~IDqFunctionGateway() = default;
+};
+
+class TDqFunctionGatewayFactory : public TThrRefBase {
+public:
+ using TPtr = TIntrusivePtr<TDqFunctionGatewayFactory>;
+
+ TDqFunctionGatewayFactory() {}
+
+ using TGatewayCreator = std::function<IDqFunctionGateway::TPtr(
+ const THashMap<TString, TString>& secureParams, const TString& connection)>;
+
+ void Register(const TDqFunctionType& type, TGatewayCreator creator);
+ bool IsKnownFunctionType(const TDqFunctionType& type);
+ IDqFunctionGateway::TPtr CreateDqFunctionGateway(const TDqFunctionType& type,
+ const THashMap<TString, TString>& secureParams,
+ const TString& connection) const;
+private:
+ std::unordered_map<TDqFunctionType, TGatewayCreator> CreatorsByType;
+};
+
+
+}
+
+
diff --git a/ydb/library/yql/providers/external_function/provider/CMakeLists.txt b/ydb/library/yql/providers/external_function/provider/CMakeLists.txt
new file mode 100644
index 0000000000..5805205044
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/provider/CMakeLists.txt
@@ -0,0 +1,30 @@
+
+# This file was gererated by the build system used internally in the Yandex monorepo.
+# Only simple modifications are allowed (adding source-files to targets, adding simple properties
+# like target_include_directories). These modifications will be ported to original
+# ya.make files by maintainers. Any complex modifications which can't be ported back to the
+# original buildsystem will not be accepted.
+
+
+
+add_library(providers-external_function-provider)
+target_compile_options(providers-external_function-provider PRIVATE
+ -DUSE_CURRENT_UDF_ABI_VERSION
+)
+target_link_libraries(providers-external_function-provider PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ common-token_accessor-client
+ providers-common-provider
+ providers-external_function-expr_nodes
+ providers-external_function-common
+ providers-external_function-gateway
+ library-yql-core
+ yql-core-expr_nodes
+)
+target_sources(providers-external_function-provider PRIVATE
+ ${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/external_function/provider/dq_function_load_meta.cpp
+ ${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/external_function/provider/dq_function_intent_transformer.cpp
+ ${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/external_function/provider/dq_function_provider.cpp
+ ${CMAKE_SOURCE_DIR}/ydb/library/yql/providers/external_function/provider/dq_function_datasource.cpp
+)
diff --git a/ydb/library/yql/providers/external_function/provider/dq_function_datasource.cpp b/ydb/library/yql/providers/external_function/provider/dq_function_datasource.cpp
new file mode 100644
index 0000000000..0889cdb711
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/provider/dq_function_datasource.cpp
@@ -0,0 +1,70 @@
+#include "dq_function_provider_impl.h"
+
+#include <ydb/library/yql/core/expr_nodes/yql_expr_nodes.h>
+#include <ydb/library/yql/core/yql_expr_type_annotation.h>
+#include <ydb/library/yql/providers/common/provider/yql_data_provider_impl.h>
+#include <ydb/library/yql/providers/common/provider/yql_provider_names.h>
+
+namespace NYql::NDqFunction {
+
+namespace {
+
+using namespace NNodes;
+
+class TDqFunctionDataSource : public TDataProviderBase {
+public:
+ TDqFunctionDataSource(TDqFunctionState::TPtr state)
+ : State(std::move(state))
+ , LoadMetaDataTransformer(CreateDqFunctionMetaLoader(State))
+ , IntentDeterminationTransformer(CreateDqFunctionIntentTransformer(State))
+ {}
+
+ TStringBuf GetName() const override {
+ return FunctionProviderName;
+ }
+
+ bool ValidateParameters(TExprNode& node, TExprContext& ctx, TMaybe<TString>& cluster) override {
+ if (node.IsCallable(TCoDataSource::CallableName())) {
+ //(DataSource 'ExternalFunction 'CloudFunction 'my_function_name 'connection_name)
+ if (!EnsureArgsCount(node, 4, ctx)) {
+ return false;
+ }
+ if (node.Head().Content() == FunctionProviderName) {
+ TDqFunctionType functionType{node.Child(1)->Content()};
+ if (!State->GatewayFactory->IsKnownFunctionType(functionType)) {
+ ctx.AddError(TIssue(ctx.GetPosition(node.Pos()), TStringBuilder() <<
+ "Unknown EXTERNAL FUNCTION type '" << functionType << "'"));
+ return false;
+ }
+ cluster = Nothing();
+ return true;
+ }
+ }
+
+ ctx.AddError(TIssue(ctx.GetPosition(node.Pos()), "Invalid ExternalFunction DataSource parameters"));
+ return false;
+ }
+
+ IGraphTransformer& GetLoadTableMetadataTransformer() override {
+ return *LoadMetaDataTransformer;
+ }
+
+ IGraphTransformer& GetIntentDeterminationTransformer() override {
+ return *IntentDeterminationTransformer;
+ }
+
+private:
+ const TDqFunctionState::TPtr State;
+ const THolder<IGraphTransformer> LoadMetaDataTransformer;
+ const THolder<TVisitorTransformerBase> IntentDeterminationTransformer;
+};
+}
+
+
+TIntrusivePtr<IDataProvider> CreateDqFunctionDataSource(TDqFunctionState::TPtr state) {
+ return new TDqFunctionDataSource(std::move(state));
+}
+
+
+
+} \ No newline at end of file
diff --git a/ydb/library/yql/providers/external_function/provider/dq_function_intent_transformer.cpp b/ydb/library/yql/providers/external_function/provider/dq_function_intent_transformer.cpp
new file mode 100644
index 0000000000..bce8645a9d
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/provider/dq_function_intent_transformer.cpp
@@ -0,0 +1,44 @@
+#include "dq_function_provider.h"
+
+#include <ydb/library/yql/providers/common/transform/yql_visit.h>
+#include <ydb/library/yql/providers/external_function/expr_nodes/dq_function_expr_nodes.h>
+
+namespace NYql::NDqFunction {
+namespace {
+
+using namespace NNodes;
+
+class TDqFunctionIntentTransformer : public TVisitorTransformerBase {
+public:
+ TDqFunctionIntentTransformer(TDqFunctionState::TPtr state)
+ : TVisitorTransformerBase(false)
+ , State(state)
+ {
+ AddHandler({TFunctionDataSource::CallableName()}, Hndl(&TDqFunctionIntentTransformer::HandleDataSource));
+ }
+
+ TStatus HandleDataSource(TExprBase input, TExprContext& ctx) {
+ Y_UNUSED(ctx);
+
+ if (!TFunctionDataSource::Match(input.Raw()))
+ return TStatus::Ok;
+
+ auto source = input.Cast<TFunctionDataSource>();
+ TDqFunctionType functionType{source.Type().Value()};
+ TString functionName{source.FunctionName().Value()};
+ TString connection{source.Connection().Value()};
+ State->FunctionsResolver->AddFunction(functionType, functionName, connection);
+
+ return TStatus::Ok;
+ }
+
+private:
+ TDqFunctionState::TPtr State;
+};
+}
+
+THolder<TVisitorTransformerBase> CreateDqFunctionIntentTransformer(TDqFunctionState::TPtr state) {
+ return THolder(new TDqFunctionIntentTransformer(state));
+}
+
+} \ No newline at end of file
diff --git a/ydb/library/yql/providers/external_function/provider/dq_function_load_meta.cpp b/ydb/library/yql/providers/external_function/provider/dq_function_load_meta.cpp
new file mode 100644
index 0000000000..9f6b9beca1
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/provider/dq_function_load_meta.cpp
@@ -0,0 +1,94 @@
+#include "dq_function_provider.h"
+
+#include <ydb/library/yql/core/yql_graph_transformer.h>
+#include <ydb/library/yql/public/issue/yql_issue.h>
+
+#include <library/cpp/threading/future/async.h>
+
+namespace NYql::NDqFunction {
+namespace {
+
+using namespace NNodes;
+
+class TDqFunctionResolverTransform : public TGraphTransformerBase {
+private:
+ struct TResolverContext : public TThrRefBase {
+ using TPtr = TIntrusivePtr<TResolverContext>;
+ TVector<TIssue> ResolveIssues;
+ TDqFunctionsSet FunctionsDescription;
+ };
+public:
+ TDqFunctionResolverTransform(TDqFunctionState::TPtr state)
+ : State(state)
+ {}
+
+ TStatus DoTransform(TExprNode::TPtr input, TExprNode::TPtr& output, TExprContext& ctx) final {
+ output = input;
+
+ if (ctx.Step.IsDone(TExprStep::LoadTablesMetadata)) {
+ return TStatus::Ok;
+ }
+
+ ResolverContext = MakeIntrusive<TResolverContext>();
+
+ auto functions = State->FunctionsResolver->FunctionsToResolve();
+ std::vector<NThreading::TFuture<void>> resolverHandles;
+ resolverHandles.reserve(functions.size());
+ auto resolverContext = ResolverContext;
+ for (auto functionDesc : functions) {
+ auto gateway = State->GatewayFactory->CreateDqFunctionGateway(
+ functionDesc.Type, {}, functionDesc.Connection);
+ auto future = gateway->ResolveFunction(State->ScopeFolderId, functionDesc.FunctionName);
+ resolverHandles.push_back(future.Apply([resolverContext]
+ (const NThreading::TFuture<TDqFunctionDescription>& future) {
+ try {
+ resolverContext->FunctionsDescription.emplace(future.GetValue());
+ } catch (const std::exception& e) {
+ resolverContext->ResolveIssues.push_back(ExceptionToIssue(e));
+ }
+ }));
+ }
+
+ if (resolverHandles.empty()) {
+ return TStatus::Ok;
+ }
+
+ AllFutures = NThreading::WaitExceptionOrAll(resolverHandles);
+ return TStatus::Async;
+ }
+
+ NThreading::TFuture<void> DoGetAsyncFuture(const TExprNode& input) final {
+ Y_UNUSED(input);
+ return AllFutures;
+ }
+
+ TStatus DoApplyAsyncChanges(TExprNode::TPtr input, TExprNode::TPtr& output, TExprContext& ctx) final {
+ Y_UNUSED(ctx);
+ YQL_ENSURE(AllFutures.HasValue());
+ output = input;
+
+ if (!ResolverContext->ResolveIssues.empty()) {
+ ctx.IssueManager.RaiseIssues(TIssues(ResolverContext->ResolveIssues));
+ ResolverContext.Reset();
+ return TStatus::Error;
+ }
+
+ for (auto function : ResolverContext->FunctionsDescription) {
+ State->FunctionsDescription.emplace(std::move(function));
+ }
+ ResolverContext.Reset();
+ return TStatus::Ok;
+ }
+
+private:
+ TDqFunctionState::TPtr State;
+ NThreading::TFuture<void> AllFutures;
+ TResolverContext::TPtr ResolverContext;
+};
+}
+
+THolder<IGraphTransformer> CreateDqFunctionMetaLoader(TDqFunctionState::TPtr state) {
+ return THolder(new TDqFunctionResolverTransform(state));
+}
+
+} \ No newline at end of file
diff --git a/ydb/library/yql/providers/external_function/provider/dq_function_provider.cpp b/ydb/library/yql/providers/external_function/provider/dq_function_provider.cpp
new file mode 100644
index 0000000000..fbcf9ce7cd
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/provider/dq_function_provider.cpp
@@ -0,0 +1,49 @@
+#include "dq_function_provider.h"
+
+#include <ydb/library/yql/providers/common/provider/yql_provider_names.h>
+#include <ydb/library/yql/providers/common/proto/gateways_config.pb.h>
+#include <ydb/library/yql/providers/common/schema/expr/yql_expr_schema.h>
+#include <ydb/library/yql/core/yql_data_provider.h>
+#include <ydb/library/yql/core/yql_type_annotation.h>
+
+namespace NYql {
+
+TDataProviderInitializer GetDqFunctionDataProviderInitializer(
+ ISecuredServiceAccountCredentialsFactory::TPtr credentialsFactory,
+ TDqFunctionGatewayFactory::TPtr gatewayFactory,
+ // TRunActorParams.TScope
+ const TString& scopeFolderId) {
+
+ return [credentialsFactory, gatewayFactory, scopeFolderId] (
+ const TString& userName,
+ const TString& sessionId,
+ const TGatewaysConfig* gatewaysConfig,
+ const NKikimr::NMiniKQL::IFunctionRegistry* functionRegistry,
+ TIntrusivePtr<IRandomProvider> randomProvider,
+ TIntrusivePtr<TTypeAnnotationContext> typeCtx,
+ const TOperationProgressWriter& progressWriter,
+ const TYqlOperationOptions& operationOptions)
+ {
+
+ Y_UNUSED(userName);
+ Y_UNUSED(gatewaysConfig);
+ Y_UNUSED(functionRegistry);
+ Y_UNUSED(randomProvider);
+ Y_UNUSED(typeCtx);
+ Y_UNUSED(progressWriter);
+ Y_UNUSED(operationOptions);
+
+ auto state = MakeIntrusive<TDqFunctionState>();
+ state->SessionId = sessionId;
+ state->GatewayFactory = gatewayFactory;
+ state->ScopeFolderId = scopeFolderId;
+
+ TDataProviderInfo provider;
+ provider.Names.insert({TString{FunctionProviderName}});
+ provider.Source = CreateDqFunctionDataSource(state);
+ // TODO Sink
+ return provider;
+ };
+}
+
+} \ No newline at end of file
diff --git a/ydb/library/yql/providers/external_function/provider/dq_function_provider.h b/ydb/library/yql/providers/external_function/provider/dq_function_provider.h
new file mode 100644
index 0000000000..3aa6566108
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/provider/dq_function_provider.h
@@ -0,0 +1,35 @@
+#pragma once
+
+#include <ydb/library/yql/providers/common/token_accessor/client/factory.h>
+#include <ydb/library/yql/providers/external_function/gateway/dq_function_gateway.h>
+#include <ydb/library/yql/providers/external_function/common/dq_function_types.h>
+#include <ydb/library/yql/providers/common/provider/yql_data_provider_impl.h>
+
+#include <util/generic/string.h>
+#include <util/generic/ptr.h>
+
+namespace NYql::NDqFunction {
+
+struct TDqFunctionState : public TThrRefBase {
+ using TPtr = TIntrusivePtr<TDqFunctionState>;
+
+ TString SessionId;
+ TString ScopeFolderId;
+
+ TDqFunctionResolver::TPtr FunctionsResolver = MakeIntrusive<TDqFunctionResolver>();
+ TDqFunctionGatewayFactory::TPtr GatewayFactory;
+ TDqFunctionsSet FunctionsDescription;
+};
+
+TIntrusivePtr<IDataProvider> CreateDqFunctionDataSource(TDqFunctionState::TPtr state);
+//TIntrusivePtr<IDataProvider> CreateDqFunctionDataSink(TDqFunctionState::TPtr state);
+}
+
+namespace NYql {
+
+TDataProviderInitializer GetDqFunctionDataProviderInitializer(
+ ISecuredServiceAccountCredentialsFactory::TPtr credentialsFactory,
+ TDqFunctionGatewayFactory::TPtr gatewayFactory,
+ const TString& scopeFolderId = {});
+
+} \ No newline at end of file
diff --git a/ydb/library/yql/providers/external_function/provider/dq_function_provider_impl.h b/ydb/library/yql/providers/external_function/provider/dq_function_provider_impl.h
new file mode 100644
index 0000000000..6c37e858eb
--- /dev/null
+++ b/ydb/library/yql/providers/external_function/provider/dq_function_provider_impl.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include "dq_function_provider.h"
+
+#include <ydb/library/yql/providers/common/transform/yql_visit.h>
+#include <ydb/library/yql/core/yql_graph_transformer.h>
+
+namespace NYql {
+
+THolder<TVisitorTransformerBase> CreateDqFunctionIntentTransformer(TDqFunctionState::TPtr state);
+THolder<IGraphTransformer> CreateDqFunctionMetaLoader(TDqFunctionState::TPtr state);
+
+} \ No newline at end of file