summaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/TableFunctions/TableFunctionExecutable.h
diff options
context:
space:
mode:
authorvitalyisaev <[email protected]>2023-11-14 09:58:56 +0300
committervitalyisaev <[email protected]>2023-11-14 10:20:20 +0300
commitc2b2dfd9827a400a8495e172a56343462e3ceb82 (patch)
treecd4e4f597d01bede4c82dffeb2d780d0a9046bd0 /contrib/clickhouse/src/TableFunctions/TableFunctionExecutable.h
parentd4ae8f119e67808cb0cf776ba6e0cf95296f2df7 (diff)
YQ Connector: move tests from yql to ydb (OSS)
Перенос папки с тестами на Коннектор из папки yql в папку ydb (синхронизируется с github).
Diffstat (limited to 'contrib/clickhouse/src/TableFunctions/TableFunctionExecutable.h')
-rw-r--r--contrib/clickhouse/src/TableFunctions/TableFunctionExecutable.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/contrib/clickhouse/src/TableFunctions/TableFunctionExecutable.h b/contrib/clickhouse/src/TableFunctions/TableFunctionExecutable.h
new file mode 100644
index 00000000000..aa595312fe4
--- /dev/null
+++ b/contrib/clickhouse/src/TableFunctions/TableFunctionExecutable.h
@@ -0,0 +1,44 @@
+#pragma once
+
+#include <TableFunctions/ITableFunction.h>
+
+namespace DB
+{
+
+class Context;
+class ASTSetQuery;
+
+/* executable(script_name_optional_arguments, format, structure, input_query) - creates a temporary storage from executable file
+ *
+ *
+ * The file must be in the clickhouse data directory.
+ * The relative path begins with the clickhouse data directory.
+ */
+class TableFunctionExecutable : public ITableFunction
+{
+public:
+ static constexpr auto name = "executable";
+
+ std::string getName() const override { return name; }
+
+ bool hasStaticStructure() const override { return true; }
+
+private:
+ StoragePtr executeImpl(const ASTPtr & ast_function, ContextPtr context, const std::string & table_name, ColumnsDescription cached_columns, bool is_insert_query) const override;
+
+ const char * getStorageTypeName() const override { return "Executable"; }
+
+ ColumnsDescription getActualTableStructure(ContextPtr context, bool is_insert_query) const override;
+
+ std::vector<size_t> skipAnalysisForArguments(const QueryTreeNodePtr & query_node_table_function, ContextPtr context) const override;
+
+ void parseArguments(const ASTPtr & ast_function, ContextPtr context) override;
+
+ String script_name;
+ std::vector<String> arguments;
+ String format;
+ String structure;
+ std::vector<ASTPtr> input_queries;
+ ASTPtr settings_query = nullptr;
+};
+}