ClickHouse/dbms/src/TableFunctions/TableFunctionRemote.h

24 lines
700 B
C++
Raw Normal View History

#pragma once
#include <TableFunctions/ITableFunction.h>
namespace DB
{
/*
2017-04-16 15:00:33 +00:00
* remote ('address', db, table) - creates a temporary StorageDistributed.
* To get the table structure, a DESC TABLE request is made to the remote server.
* For example
* SELECT count() FROM remote('example01-01-1', merge, hits) - go to `example01-01-1`, in the merge database, the hits table.
* An expression that generates a lot of shards and replicas can also be specified as the host name - see below.
*/
class TableFunctionRemote : public ITableFunction
{
public:
std::string getName() const override { return "remote"; }
StoragePtr execute(ASTPtr ast_function, Context & context) const override;
};
}