2014-01-28 16:45:10 +00:00
|
|
|
#include <boost/assign/list_inserter.hpp>
|
|
|
|
|
|
|
|
#include <DB/TableFunctions/TableFunctionMerge.h>
|
|
|
|
#include <DB/TableFunctions/TableFunctionRemote.h>
|
|
|
|
|
|
|
|
#include <DB/TableFunctions/TableFunctionFactory.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
TableFunctionPtr TableFunctionFactory::get(
|
|
|
|
const String & name,
|
|
|
|
const Context & context) const
|
|
|
|
{
|
2014-02-25 17:37:50 +00:00
|
|
|
if (context.getSettings().limits.readonly)
|
|
|
|
throw Exception("Table functions are forbidden in readonly mode", ErrorCodes::READONLY);
|
|
|
|
|
2014-01-28 16:45:10 +00:00
|
|
|
if (name == "merge") return new TableFunctionMerge;
|
|
|
|
else if (name == "remote") return new TableFunctionRemote;
|
|
|
|
else
|
|
|
|
throw Exception("Unknown function " + name, ErrorCodes::UNKNOWN_FUNCTION);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|