aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorifsmirnov <ifsmirnov@yandex-team.com>2022-10-27 15:26:53 +0300
committerifsmirnov <ifsmirnov@yandex-team.com>2022-10-27 15:26:53 +0300
commit4d05deef52c4b096f042ad1ff65284e2c411cae1 (patch)
treeffefd52bfe3cf9c9fbeb142d1dae8eb1e105115e
parent2a0b57f3998e3db7905b20ecd6218e62e3206d3a (diff)
downloadydb-4d05deef52c4b096f042ad1ff65284e2c411cae1.tar.gz
Extract TDigest from YQL to library
-rw-r--r--library/cpp/CMakeLists.darwin.txt1
-rw-r--r--library/cpp/CMakeLists.linux-aarch64.txt1
-rw-r--r--library/cpp/CMakeLists.linux.txt1
-rw-r--r--library/cpp/tdigest/CMakeLists.txt34
-rw-r--r--library/cpp/tdigest/tdigest.cpp (renamed from ydb/library/yql/udfs/common/stat/static/tdigest.cpp)4
-rw-r--r--library/cpp/tdigest/tdigest.h (renamed from ydb/library/yql/udfs/common/stat/static/tdigest.h)0
-rw-r--r--library/cpp/tdigest/tdigest.proto (renamed from ydb/library/yql/udfs/common/stat/static/tdigest.proto)0
-rw-r--r--ydb/library/yql/udfs/common/stat/static/CMakeLists.txt20
-rw-r--r--ydb/library/yql/udfs/common/stat/static/stat_udf.h3
9 files changed, 43 insertions, 21 deletions
diff --git a/library/cpp/CMakeLists.darwin.txt b/library/cpp/CMakeLists.darwin.txt
index 2be083d69c..a58afa12b2 100644
--- a/library/cpp/CMakeLists.darwin.txt
+++ b/library/cpp/CMakeLists.darwin.txt
@@ -72,6 +72,7 @@ add_subdirectory(sse)
add_subdirectory(streams)
add_subdirectory(string_utils)
add_subdirectory(svnversion)
+add_subdirectory(tdigest)
add_subdirectory(terminate_handler)
add_subdirectory(testing)
add_subdirectory(threading)
diff --git a/library/cpp/CMakeLists.linux-aarch64.txt b/library/cpp/CMakeLists.linux-aarch64.txt
index 186786aa77..d0f76a6815 100644
--- a/library/cpp/CMakeLists.linux-aarch64.txt
+++ b/library/cpp/CMakeLists.linux-aarch64.txt
@@ -71,6 +71,7 @@ add_subdirectory(sse)
add_subdirectory(streams)
add_subdirectory(string_utils)
add_subdirectory(svnversion)
+add_subdirectory(tdigest)
add_subdirectory(terminate_handler)
add_subdirectory(testing)
add_subdirectory(threading)
diff --git a/library/cpp/CMakeLists.linux.txt b/library/cpp/CMakeLists.linux.txt
index 2be083d69c..a58afa12b2 100644
--- a/library/cpp/CMakeLists.linux.txt
+++ b/library/cpp/CMakeLists.linux.txt
@@ -72,6 +72,7 @@ add_subdirectory(sse)
add_subdirectory(streams)
add_subdirectory(string_utils)
add_subdirectory(svnversion)
+add_subdirectory(tdigest)
add_subdirectory(terminate_handler)
add_subdirectory(testing)
add_subdirectory(threading)
diff --git a/library/cpp/tdigest/CMakeLists.txt b/library/cpp/tdigest/CMakeLists.txt
new file mode 100644
index 0000000000..79eb2709d9
--- /dev/null
+++ b/library/cpp/tdigest/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(library-cpp-tdigest)
+target_link_libraries(library-cpp-tdigest PUBLIC
+ contrib-libs-cxxsupp
+ yutil
+ contrib-libs-protobuf
+)
+target_proto_messages(library-cpp-tdigest PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/tdigest/tdigest.proto
+)
+target_sources(library-cpp-tdigest PRIVATE
+ ${CMAKE_SOURCE_DIR}/library/cpp/tdigest/tdigest.cpp
+)
+target_proto_addincls(library-cpp-tdigest
+ ./
+ ${CMAKE_SOURCE_DIR}/
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
+)
+target_proto_outs(library-cpp-tdigest
+ --cpp_out=${CMAKE_BINARY_DIR}/
+ --cpp_styleguide_out=${CMAKE_BINARY_DIR}/
+)
diff --git a/ydb/library/yql/udfs/common/stat/static/tdigest.cpp b/library/cpp/tdigest/tdigest.cpp
index b8668eb27b..480425d2e2 100644
--- a/ydb/library/yql/udfs/common/stat/static/tdigest.cpp
+++ b/library/cpp/tdigest/tdigest.cpp
@@ -1,5 +1,7 @@
#include "tdigest.h"
-#include <ydb/library/yql/udfs/common/stat/static/tdigest.pb.h>
+
+#include <library/cpp/tdigest/tdigest.pb.h>
+
#include <cmath>
// TODO: rewrite to https://github.com/tdunning/t-digest/blob/master/src/main/java/com/tdunning/math/stats/MergingDigest.java
diff --git a/ydb/library/yql/udfs/common/stat/static/tdigest.h b/library/cpp/tdigest/tdigest.h
index acec0a0264..acec0a0264 100644
--- a/ydb/library/yql/udfs/common/stat/static/tdigest.h
+++ b/library/cpp/tdigest/tdigest.h
diff --git a/ydb/library/yql/udfs/common/stat/static/tdigest.proto b/library/cpp/tdigest/tdigest.proto
index 4a2db3e638..4a2db3e638 100644
--- a/ydb/library/yql/udfs/common/stat/static/tdigest.proto
+++ b/library/cpp/tdigest/tdigest.proto
diff --git a/ydb/library/yql/udfs/common/stat/static/CMakeLists.txt b/ydb/library/yql/udfs/common/stat/static/CMakeLists.txt
index 633ae92251..04c5cc324f 100644
--- a/ydb/library/yql/udfs/common/stat/static/CMakeLists.txt
+++ b/ydb/library/yql/udfs/common/stat/static/CMakeLists.txt
@@ -16,27 +16,9 @@ target_compile_options(common-stat-static PRIVATE
target_link_libraries(common-stat-static PUBLIC
contrib-libs-cxxsupp
yutil
- contrib-libs-protobuf
- util-draft
yql-public-udf
-)
-target_proto_messages(common-stat-static PRIVATE
- ${CMAKE_SOURCE_DIR}/ydb/library/yql/udfs/common/stat/static/tdigest.proto
+ library-cpp-tdigest
)
target_sources(common-stat-static PRIVATE
${CMAKE_SOURCE_DIR}/ydb/library/yql/udfs/common/stat/static/static_udf.cpp
- ${CMAKE_SOURCE_DIR}/ydb/library/yql/udfs/common/stat/static/tdigest.cpp
-)
-target_proto_addincls(common-stat-static
- ./
- ${CMAKE_SOURCE_DIR}/
- ${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
- ${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
-)
-target_proto_outs(common-stat-static
- --cpp_out=${CMAKE_BINARY_DIR}/
- --cpp_styleguide_out=${CMAKE_BINARY_DIR}/
)
diff --git a/ydb/library/yql/udfs/common/stat/static/stat_udf.h b/ydb/library/yql/udfs/common/stat/static/stat_udf.h
index 6eb6203051..7cc4f8abb5 100644
--- a/ydb/library/yql/udfs/common/stat/static/stat_udf.h
+++ b/ydb/library/yql/udfs/common/stat/static/stat_udf.h
@@ -2,7 +2,8 @@
#include <ydb/library/yql/public/udf/udf_helpers.h>
#include <ydb/library/yql/public/udf/udf_value_builder.h>
-#include "tdigest.h"
+
+#include <library/cpp/tdigest/tdigest.h>
using namespace NYql;
using namespace NUdf;