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

Method executeImpl

src/TableFunctions/TableFunctionValues.cpp:166–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164
165template <bool interpret_first_argument_as_structure>
166StoragePtr TableFunctionValues<interpret_first_argument_as_structure>::executeImpl(const ASTPtr & ast_function, ContextPtr context, const std::string & table_name, ColumnsDescription /*cached_columns*/, bool is_insert_query) const
167{
168 auto columns = getActualTableStructure(context, is_insert_query);
169
170 Block sample_block;
171 for (const auto & name_type : columns.getOrdinary())
172 sample_block.insert({ name_type.type->createColumn(), name_type.type, name_type.name });
173
174 MutableColumns res_columns = sample_block.cloneEmptyColumns();
175
176 ASTs & args = ast_function->children.at(0)->children;
177
178 /// Parsing other arguments as values and inserting them into columns
179 parseAndInsertValues(res_columns, args, sample_block, has_structure_in_arguments ? 1 : 0, context);
180
181 Block res_block = sample_block.cloneWithColumns(std::move(res_columns));
182
183 auto res = std::make_shared<StorageValues>(StorageID(getDatabaseName(), table_name), columns, res_block);
184 res->startup();
185 return res;
186}
187
188}
189

Callers

nothing calls this directly

Calls 9

parseAndInsertValuesFunction · 0.85
getOrdinaryMethod · 0.80
cloneWithColumnsMethod · 0.80
StorageIDClass · 0.50
insertMethod · 0.45
createColumnMethod · 0.45
cloneEmptyColumnsMethod · 0.45
atMethod · 0.45
startupMethod · 0.45

Tested by

no test coverage detected