#include #include #include #include #include #include namespace DB { namespace ErrorCodes { extern const int READONLY; extern const int UNKNOWN_FUNCTION; } TableFunctionPtr TableFunctionFactory::get( const std::string & name, const Context & context) const { if (context.getSettings().limits.readonly == 1) /** For example, for readonly = 2 - allowed. */ throw Exception("Table functions are forbidden in readonly mode", ErrorCodes::READONLY); if (name == "merge") return std::make_shared(); else if (name == "remote") return std::make_shared(); else if (name == "shardByHash") return std::make_shared(); else throw Exception("Unknown table function " + name, ErrorCodes::UNKNOWN_FUNCTION); } }