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

Method executeImpl

src/TableFunctions/TableFunctionViewIfPermitted.cpp:97–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97StoragePtr TableFunctionViewIfPermitted::executeImpl(
98 const ASTPtr & /* ast_function */, ContextPtr context, const std::string & table_name, ColumnsDescription /* cached_columns */, bool is_insert_query) const
99{
100 StoragePtr storage;
101 auto columns = getActualTableStructure(context, is_insert_query);
102
103 if (isPermitted(context, columns))
104 {
105 storage = std::make_shared<StorageView>(StorageID(getDatabaseName(), table_name), create, columns, "");
106 }
107 else
108 {
109 storage = else_table_function->execute(else_ast, context, table_name);
110 }
111
112 storage->startup();
113 return storage;
114}
115
116bool TableFunctionViewIfPermitted::isPermitted(const ContextPtr & context, const ColumnsDescription & else_columns) const
117{

Callers

nothing calls this directly

Calls 3

StorageIDClass · 0.50
executeMethod · 0.45
startupMethod · 0.45

Tested by

no test coverage detected