ClickHouse/dbms/include/DB/TableFunctions/ITableFunction.h
alexey-milovidov ed5b521110 Less dependencies 2 (#378)
* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].

* Less dependencies [#CLICKHOUSE-2].
2017-01-21 08:24:28 +04:00

44 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include <string>
#include <memory>
namespace DB
{
class Context;
class IAST;
using ASTPtr = std::shared_ptr<IAST>;
class IStorage;
using StoragePtr = std::shared_ptr<IStorage>;
/** Интерфейс для табличных функций.
*
* Табличные функции не имеют отношения к другим функциям.
* Табличная функция может быть указана в секции FROM вместо [db.]table
* Табличная функция возвращает временный объект StoragePtr, который используется для выполнения запроса.
*
* Пример:
* SELECT count() FROM remote('example01-01-1', merge, hits)
* - пойти на example01-01-1, в БД merge, таблицу hits.
*/
class ITableFunction
{
public:
/// Получить основное имя функции.
virtual std::string getName() const = 0;
/// Создать storage в соответствии с запросом
virtual StoragePtr execute(ASTPtr ast_function, Context & context) const = 0;
virtual ~ITableFunction() {};
};
using TableFunctionPtr = std::shared_ptr<ITableFunction>;
}