2021-03-19 12:47:27 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <TableFunctions/ITableFunction.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
class Context;
|
|
|
|
|
2021-10-04 18:09:32 +00:00
|
|
|
/// dictionary(dictionary_name) - creates a temporary storage from dictionary
|
2021-03-19 12:47:27 +00:00
|
|
|
class TableFunctionDictionary final : public ITableFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "dictionary";
|
|
|
|
std::string getName() const override
|
|
|
|
{
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2021-04-10 23:33:54 +00:00
|
|
|
void parseArguments(const ASTPtr & ast_function, ContextPtr context) override;
|
2021-03-19 12:47:27 +00:00
|
|
|
|
2023-07-06 08:56:07 +00:00
|
|
|
ColumnsDescription getActualTableStructure(ContextPtr context, bool is_insert_query) const override;
|
2021-03-19 12:47:27 +00:00
|
|
|
|
2023-07-06 08:56:07 +00:00
|
|
|
StoragePtr executeImpl(const ASTPtr & ast_function, ContextPtr context, const std::string & table_name, ColumnsDescription, bool is_insert_query) const override;
|
2021-03-19 12:47:27 +00:00
|
|
|
|
|
|
|
const char * getStorageTypeName() const override { return "Dictionary"; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
String dictionary_name;
|
|
|
|
ColumnsDescription dictionary_columns;
|
2023-11-06 03:33:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|