2014-01-28 16:45:10 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <TableFunctions/ITableFunction.h>
|
2014-09-23 15:28:21 +00:00
|
|
|
|
2014-01-28 16:45:10 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2017-05-23 18:44:36 +00:00
|
|
|
/* remote ('address', db, table) - creates a temporary StorageDistributed.
|
2017-04-16 15:00:33 +00:00
|
|
|
* 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.
|
2014-01-28 16:45:10 +00:00
|
|
|
*/
|
2014-02-23 00:37:25 +00:00
|
|
|
class TableFunctionRemote : public ITableFunction
|
2014-01-28 16:45:10 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-04-01 07:20:54 +00:00
|
|
|
std::string getName() const override { return "remote"; }
|
2017-05-23 18:46:52 +00:00
|
|
|
StoragePtr execute(const ASTPtr & ast_function, const Context & context) const override;
|
2014-02-07 15:11:57 +00:00
|
|
|
};
|
2014-01-28 16:45:10 +00:00
|
|
|
|
|
|
|
}
|