aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Interpreters/ExternalLoaderTempConfigRepository.cpp
diff options
context:
space:
mode:
authorvitalyisaev <vitalyisaev@ydb.tech>2023-11-14 09:58:56 +0300
committervitalyisaev <vitalyisaev@ydb.tech>2023-11-14 10:20:20 +0300
commitc2b2dfd9827a400a8495e172a56343462e3ceb82 (patch)
treecd4e4f597d01bede4c82dffeb2d780d0a9046bd0 /contrib/clickhouse/src/Interpreters/ExternalLoaderTempConfigRepository.cpp
parentd4ae8f119e67808cb0cf776ba6e0cf95296f2df7 (diff)
downloadydb-c2b2dfd9827a400a8495e172a56343462e3ceb82.tar.gz
YQ Connector: move tests from yql to ydb (OSS)
Перенос папки с тестами на Коннектор из папки yql в папку ydb (синхронизируется с github).
Diffstat (limited to 'contrib/clickhouse/src/Interpreters/ExternalLoaderTempConfigRepository.cpp')
-rw-r--r--contrib/clickhouse/src/Interpreters/ExternalLoaderTempConfigRepository.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/contrib/clickhouse/src/Interpreters/ExternalLoaderTempConfigRepository.cpp b/contrib/clickhouse/src/Interpreters/ExternalLoaderTempConfigRepository.cpp
new file mode 100644
index 0000000000..10fc61a2ed
--- /dev/null
+++ b/contrib/clickhouse/src/Interpreters/ExternalLoaderTempConfigRepository.cpp
@@ -0,0 +1,46 @@
+#include <Interpreters/ExternalLoaderTempConfigRepository.h>
+#include <Common/Exception.h>
+
+
+namespace DB
+{
+namespace ErrorCodes
+{
+ extern const int BAD_ARGUMENTS;
+}
+
+
+ExternalLoaderTempConfigRepository::ExternalLoaderTempConfigRepository(const String & repository_name_, const String & path_, const LoadablesConfigurationPtr & config_)
+ : name(repository_name_), path(path_), config(config_) {}
+
+
+std::set<String> ExternalLoaderTempConfigRepository::getAllLoadablesDefinitionNames()
+{
+ std::set<String> paths;
+ paths.insert(path);
+ return paths;
+}
+
+
+bool ExternalLoaderTempConfigRepository::exists(const String & path_)
+{
+ return path == path_;
+}
+
+
+Poco::Timestamp ExternalLoaderTempConfigRepository::getUpdateTime(const String & path_)
+{
+ if (!exists(path_))
+ throw Exception(ErrorCodes::BAD_ARGUMENTS, "Loadable {} not found", path_);
+ return creation_time;
+}
+
+
+LoadablesConfigurationPtr ExternalLoaderTempConfigRepository::load(const String & path_)
+{
+ if (!exists(path_))
+ throw Exception(ErrorCodes::BAD_ARGUMENTS, "Loadable {} not found", path_);
+ return config;
+}
+
+}