MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / get

Method get

src/TableFunctions/TableFunctionFactory.cpp:40–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40TableFunctionPtr TableFunctionFactory::get(
41 const ASTPtr & ast_function,
42 ContextPtr context) const
43{
44 const auto * table_function = ast_function->as<ASTFunction>();
45 if (!table_function)
46 throw Exception(ErrorCodes::LOGICAL_ERROR,
47 "Expected a table function (ASTFunction) but got '{}'", ast_function->formatForErrorMessage());
48
49 auto res = tryGet(table_function->name, context);
50 if (!res)
51 {
52 auto hints = getHints(table_function->name);
53 if (!hints.empty())
54 throw Exception(ErrorCodes::UNKNOWN_FUNCTION, "Unknown table function {}. Maybe you meant: {}", table_function->name, toString(hints));
55 throw Exception(ErrorCodes::UNKNOWN_FUNCTION, "Unknown table function {}", table_function->name);
56 }
57
58 res->parseArguments(ast_function, context);
59 return res;
60}
61
62TableFunctionPtr TableFunctionFactory::tryGet(
63 const std::string & name_param,

Callers 13

executeImplMethod · 0.45
executeImplMethod · 0.45
parseArgumentsMethod · 0.45
parseAndInsertValuesFunction · 0.45
getTypesFromArgumentFunction · 0.45
executeImplMethod · 0.45
parseArgumentsMethod · 0.45
parseArgumentsMethod · 0.45

Calls 5

ExceptionClass · 0.50
toStringFunction · 0.50
formatForErrorMessageMethod · 0.45
emptyMethod · 0.45
parseArgumentsMethod · 0.45

Tested by

no test coverage detected