The Cartesian product of two sets of rows, the result is written in place of the first argument
| 15 | |
| 16 | /// The Cartesian product of two sets of rows, the result is written in place of the first argument |
| 17 | static void append(std::vector<String> & to, const std::vector<String> & what, size_t max_addresses) |
| 18 | { |
| 19 | if (what.empty()) |
| 20 | return; |
| 21 | |
| 22 | if (to.empty()) |
| 23 | { |
| 24 | to = what; |
| 25 | return; |
| 26 | } |
| 27 | |
| 28 | if (what.size() * to.size() > max_addresses) |
| 29 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Table function 'remote': first argument generates too many result addresses"); |
| 30 | std::vector<String> res; |
| 31 | for (const auto & elem_to : to) |
| 32 | for (const auto & elem_what : what) |
| 33 | res.push_back(elem_to + elem_what); |
| 34 | |
| 35 | to.swap(res); |
| 36 | } |
| 37 | |
| 38 | |
| 39 | /// Parse number from substring |
no test coverage detected