mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-14 11:33:46 +00:00
72b1339656
This reverts commit c65d1e5c70
.
31 lines
946 B
C++
31 lines
946 B
C++
#pragma once
|
|
|
|
#include <TableFunctions/ITableFunction.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/* merge (db_name, tables_regexp) - creates a temporary StorageMerge.
|
|
* The structure of the table is taken from the first table that came up, suitable for regexp.
|
|
* If there is no such table, an exception is thrown.
|
|
*/
|
|
class TableFunctionMerge : public ITableFunction
|
|
{
|
|
public:
|
|
static constexpr auto name = "merge";
|
|
std::string getName() const override { return name; }
|
|
private:
|
|
StoragePtr executeImpl(const ASTPtr & ast_function, const Context & context, const std::string & table_name, ColumnsDescription cached_columns) const override;
|
|
const char * getStorageTypeName() const override { return "Merge"; }
|
|
|
|
ColumnsDescription getActualTableStructure(const Context & context) const override;
|
|
void parseArguments(const ASTPtr & ast_function, const Context & context) override;
|
|
|
|
String source_database;
|
|
String table_name_regexp;
|
|
};
|
|
|
|
|
|
}
|