| 47 | } |
| 48 | |
| 49 | ColumnsWithTypeAndName FunctionNode::getArgumentColumns() const |
| 50 | { |
| 51 | const auto & arguments = getArguments().getNodes(); |
| 52 | size_t arguments_size = arguments.size(); |
| 53 | |
| 54 | ColumnsWithTypeAndName argument_columns; |
| 55 | argument_columns.reserve(arguments.size()); |
| 56 | |
| 57 | for (size_t i = 0; i < arguments_size; ++i) |
| 58 | { |
| 59 | const auto & argument = arguments[i]; |
| 60 | |
| 61 | ColumnWithTypeAndName argument_column; |
| 62 | |
| 63 | auto * constant = argument->as<ConstantNode>(); |
| 64 | if (isNameOfInFunction(function_name) && i == 1) |
| 65 | { |
| 66 | argument_column.type = std::make_shared<DataTypeSet>(); |
| 67 | if (constant) |
| 68 | { |
| 69 | /// Created but not filled for the analysis during function resolution. |
| 70 | FutureSetPtr empty_set; |
| 71 | argument_column.column = ColumnConst::create(ColumnSet::create(1, empty_set), 1); |
| 72 | } |
| 73 | } |
| 74 | else |
| 75 | argument_column.type = argument->getResultType(); |
| 76 | |
| 77 | if (constant && !isNotCreatable(argument_column.type)) |
| 78 | argument_column.column = constant->getColumn(); |
| 79 | |
| 80 | argument_columns.push_back(std::move(argument_column)); |
| 81 | } |
| 82 | |
| 83 | return argument_columns; |
| 84 | } |
| 85 | |
| 86 | AggregateFunctionPtr FunctionNode::getAggregateFunction() const |
| 87 | { |
no test coverage detected