MCPcopy Create free account
hub / github.com/bytedance/bolt / registerAggregateFunc

Function registerAggregateFunc

bolt/exec/tests/AggregateFunctionRegistryTest.cpp:111–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109};
110
111bool 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

Callers 2

FunctionRegistryTestMethod · 0.85
TEST_FFunction · 0.85

Calls 5

isPartialOutputFunction · 0.85
ARRAYFunction · 0.85
signaturesFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected