| 109 | }; |
| 110 | |
| 111 | bool registerAggregateFunc(const std::string& name, bool overwrite = false) { |
| 112 | auto signatures = AggregateFunc::signatures(); |
| 113 | |
| 114 | return registerAggregateFunction( |
| 115 | name, |
| 116 | std::move(signatures), |
| 117 | [&](core::AggregationNode::Step step, |
| 118 | const std::vector<TypePtr>& argTypes, |
| 119 | const TypePtr& resultType, |
| 120 | const core::QueryConfig& |
| 121 | /*config*/) -> std::unique_ptr<exec::Aggregate> { |
| 122 | if (isPartialOutput(step)) { |
| 123 | if (argTypes.empty()) { |
| 124 | return std::make_unique<AggregateFunc>(resultType); |
| 125 | } |
| 126 | return std::make_unique<AggregateFunc>(ARRAY(resultType)); |
| 127 | } |
| 128 | return std::make_unique<AggregateFunc>(resultType); |
| 129 | }, |
| 130 | /*registerCompanionFunctions*/ false, |
| 131 | overwrite) |
| 132 | .mainFunction; |
| 133 | } |
| 134 | |
| 135 | } // namespace |
| 136 |
no test coverage detected