summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Zuikov <[email protected]>2022-06-14 21:11:54 +0300
committerArtem Zuikov <[email protected]>2022-06-14 21:11:54 +0300
commitd6f7808571d965e693402934343c5509d5038ca6 (patch)
tree38d450b449858677d175ce008b5d6110cddc9e4b
parentb9df4aa6e60fc28e81d4b6c4fa57b7333fc3fdc6 (diff)
KIKIMR-11746: remove unneeded file
ref:5abdea1babf94f155332e0fc749b74ba9659c2a8
-rw-r--r--ydb/core/formats/function_factory.h75
1 files changed, 0 insertions, 75 deletions
diff --git a/ydb/core/formats/function_factory.h b/ydb/core/formats/function_factory.h
deleted file mode 100644
index 4c61a3387cb..00000000000
--- a/ydb/core/formats/function_factory.h
+++ /dev/null
@@ -1,75 +0,0 @@
-#pragma once
-
-#include <ydb/core/formats/arrow/compute/registry.h>
-#include <ydb/core/formats/arrow/result.h>
-#include <ydb/core/formats/arrow/status.h>
-
-#include <algorithm>
-#include <memory>
-#include <shared_mutex>
-#include <string>
-#include <unordered_map>
-#include <utility>
-
-#include <ydb/core/formats/arrow/compute/function.h>
-
-namespace NKikimr::NArrow {
-
-template <bool mt = false>
-class TFunctionFactory {
-public:
-
- TFunctionFactory() = default;
-
- arrow::Status AddFunction(std::shared_ptr<arrow::compute::Function> function, bool allowOverwrite) {
- auto it = nameToFunc.find(function->name());
- if (it != nameToFunc.end() && !allowOverwrite) {
- return arrow::Status::KeyError("Already have a function registered with name: ", function->name());
- }
- nameToFunc[function->name()] = std::move(function);
- return arrow::Status::OK();
- }
-
-
- arrow::Result<std::shared_ptr<arrow::compute::Function>> GetFunction(const std::string& name) const {
- auto it = nameToFunc.find(name);
- if (it == nameToFunc.end()) {
- return arrow::compute::GetFunctionRegistry()->GetFunction(name);
- }
- return it->second;
- }
-private:
- std::unordered_map<std::string, std::shared_ptr<arrow::compute::Function>> nameToFunc;
-};
-
-template <>
-class TFunctionFactory<true> {
-public:
-
- TFunctionFactory() = default;
-
- arrow::Status AddFunction(std::shared_ptr<arrow::compute::Function> function, bool allowOverwrite) {
- std::unique_lock guard(lock);
- auto it = nameToFunc.find(function->name());
- if (it != nameToFunc.end() && !allowOverwrite) {
- return arrow::Status::KeyError("Already have a function registered with name: ", function->name());
- }
- nameToFunc[function->name()] = std::move(function);
- return arrow::Status::OK();
- }
-
-
- arrow::Result<std::shared_ptr<arrow::compute::Function>> GetFunction(const std::string& name) const {
- std::shared_lock guard(lock);
- auto it = nameToFunc.find(name);
- if (it == nameToFunc.end()) {
- return arrow::compute::GetFunctionRegistry()->GetFunction(name);
- }
- return it->second;
- }
-private:
- mutable std::shared_mutex lock;
- std::unordered_map<std::string, std::shared_ptr<arrow::compute::Function>> nameToFunc;
-};
-
-}