| 613 | } |
| 614 | |
| 615 | static ColumnWithTypeAndName executeActionForHeader(const ActionsDAG::Node * node, ColumnsWithTypeAndName arguments) |
| 616 | { |
| 617 | ColumnWithTypeAndName res_column; |
| 618 | res_column.type = node->result_type; |
| 619 | res_column.name = node->result_name; |
| 620 | |
| 621 | switch (node->type) |
| 622 | { |
| 623 | case ActionsDAG::ActionType::FUNCTION: |
| 624 | { |
| 625 | // bool all_args_are_const = true; |
| 626 | |
| 627 | // for (const auto & argument : arguments) |
| 628 | // if (typeid_cast<const ColumnConst *>(argument.column.get()) == nullptr) |
| 629 | // all_args_are_const = false; |
| 630 | |
| 631 | res_column.column = node->function->execute(arguments, res_column.type, 0, true); |
| 632 | |
| 633 | // if (!all_args_are_const) |
| 634 | // res_column.column = res_column.column->convertToFullColumnIfConst(); |
| 635 | |
| 636 | break; |
| 637 | } |
| 638 | |
| 639 | case ActionsDAG::ActionType::ARRAY_JOIN: |
| 640 | { |
| 641 | auto key = arguments.at(0); |
| 642 | key.column = key.column->convertToFullColumnIfConst(); |
| 643 | const auto * array = getArrayJoinColumnRawPtr(key.column); |
| 644 | |
| 645 | if (!array) |
| 646 | throw Exception(ErrorCodes::TYPE_MISMATCH, |
| 647 | "ARRAY JOIN of not array nor map: {}", node->result_name); |
| 648 | |
| 649 | res_column.column = array->getDataPtr()->cloneEmpty(); |
| 650 | break; |
| 651 | } |
| 652 | |
| 653 | case ActionsDAG::ActionType::COLUMN: |
| 654 | { |
| 655 | res_column.column = node->column->cloneResized(0); |
| 656 | break; |
| 657 | } |
| 658 | |
| 659 | case ActionsDAG::ActionType::ALIAS: |
| 660 | { |
| 661 | res_column.column = arguments.at(0).column; |
| 662 | break; |
| 663 | } |
| 664 | |
| 665 | case ActionsDAG::ActionType::INPUT: |
| 666 | { |
| 667 | break; |
| 668 | } |
| 669 | |
| 670 | case ActionsDAG::ActionType::PREPARED_COLUMN: |
| 671 | { |
| 672 | break; |
no test coverage detected