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

Method getTable

src/Databases/IDatabase.cpp:33–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33StoragePtr IDatabase::getTable(const String & name, ContextPtr context) const
34{
35 if (auto storage = tryGetTable(name, context))
36 return storage;
37
38 TableNameHints hints(this->shared_from_this(), context);
39 /// hint is a pair which holds a single database_name and table_name suggestion for the given table name.
40 auto hint = hints.getHintForTable(name);
41
42 if (hint.first.empty())
43 throw Exception(ErrorCodes::UNKNOWN_TABLE, "Table {}.{} does not exist", backQuoteIfNeed(getDatabaseName()), backQuoteIfNeed(name));
44 throw Exception(
45 ErrorCodes::UNKNOWN_TABLE,
46 "Table {}.{} does not exist. Maybe you meant {}.{}?",
47 backQuoteIfNeed(getDatabaseName()),
48 backQuoteIfNeed(name),
49 backQuoteIfNeed(hint.first),
50 backQuoteIfNeed(hint.second));
51}
52
53IDatabase::IDatabase(String database_name_) : database_name(std::move(database_name_))
54{

Callers 15

fuzzCreateQueryMethod · 0.45
notifyQueryFailedMethod · 0.45
initAndCheckTaskMethod · 0.45
visitCreateQueryFunction · 0.45
createTableFromASTFunction · 0.45
createTableMethod · 0.45
commitCreateTableMethod · 0.45
checkReplicaPathExistsFunction · 0.45
loadTablesMetadataMethod · 0.45

Calls 6

tryGetTableFunction · 0.85
backQuoteIfNeedFunction · 0.85
getHintForTableMethod · 0.80
ExceptionClass · 0.50
shared_from_thisMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected