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

Method getCreateDatabaseQueryImpl

src/Databases/DatabaseHDFS.cpp:189–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187}
188
189ASTPtr DatabaseHDFS::getCreateDatabaseQueryImpl() const
190{
191 const auto & settings = getContext()->getSettingsRef();
192 ParserCreateQuery parser;
193
194 const String query = fmt::format("CREATE DATABASE {} ENGINE = HDFS('{}')", backQuoteIfNeed(database_name), source);
195 ASTPtr ast
196 = parseQuery(parser, query.data(), query.data() + query.size(), "", 0, settings[Setting::max_parser_depth], settings[Setting::max_parser_backtracks]);
197
198 if (!comment.empty())
199 {
200 auto & ast_create_query = ast->as<ASTCreateQuery &>();
201 ast_create_query.set(ast_create_query.comment, make_intrusive<ASTLiteral>(comment));
202 }
203
204 return ast;
205}
206
207void DatabaseHDFS::shutdown()
208{

Callers

nothing calls this directly

Calls 8

backQuoteIfNeedFunction · 0.85
parseQueryFunction · 0.85
getContextFunction · 0.50
formatFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected