| 320 | } |
| 321 | |
| 322 | static const ASTArrayJoin * getFirstArrayJoin(const ASTSelectQuery & select) |
| 323 | { |
| 324 | if (!select.tables()) |
| 325 | return {}; |
| 326 | |
| 327 | const auto & tables_in_select_query = select.tables()->as<ASTTablesInSelectQuery &>(); |
| 328 | if (tables_in_select_query.children.empty()) |
| 329 | return {}; |
| 330 | |
| 331 | const ASTArrayJoin * array_join = nullptr; |
| 332 | for (const auto & child : tables_in_select_query.children) |
| 333 | { |
| 334 | const auto & tables_element = child->as<ASTTablesInSelectQueryElement &>(); |
| 335 | if (tables_element.array_join) |
| 336 | { |
| 337 | if (!array_join) |
| 338 | array_join = tables_element.array_join->as<ASTArrayJoin>(); |
| 339 | else |
| 340 | throw Exception("Support for more than one ARRAY JOIN in query is not implemented", ErrorCodes::NOT_IMPLEMENTED); |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | return array_join; |
| 345 | } |
| 346 | |
| 347 | static const ASTTablesInSelectQueryElement * getFirstTableJoin(const ASTSelectQuery & select) |
| 348 | { |
no test coverage detected