MCPcopy Create free account
hub / github.com/ByConity/ByConity / registerFunction

Method registerFunction

src/TableFunctions/TableFunctionFactory.cpp:21–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21void TableFunctionFactory::registerFunction(const std::string & name, Value creator, CaseSensitiveness case_sensitiveness)
22{
23 if (!table_functions.emplace(name, creator).second)
24 throw Exception("TableFunctionFactory: the table function name '" + name + "' is not unique",
25 ErrorCodes::LOGICAL_ERROR);
26
27 if (case_sensitiveness == CaseInsensitive
28 && !case_insensitive_table_functions.emplace(Poco::toLower(name), creator).second)
29 throw Exception("TableFunctionFactory: the case insensitive table function name '" + name + "' is not unique",
30 ErrorCodes::LOGICAL_ERROR);
31
32 KnownTableFunctionNames::instance().add(name, (case_sensitiveness == CaseInsensitive));
33}
34
35TableFunctionPtr TableFunctionFactory::get(
36 const ASTPtr & ast_function,

Callers 2

Calls 3

ExceptionClass · 0.50
emplaceMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected