| 164 | |
| 165 | template <bool interpret_first_argument_as_structure> |
| 166 | StoragePtr 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 |
nothing calls this directly
no test coverage detected