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

Function TEST_F

bolt/exec/tests/AggregateCompanionAdapterTest.cpp:108–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106};
107
108TEST_F(AggregateCompanionRegistryTest, basic) {
109 std::vector<std::shared_ptr<AggregateFunctionSignature>> signatures{
110 AggregateFunctionSignatureBuilder()
111 .returnType("double")
112 .intermediateType("array(double)")
113 .argumentType("double")
114 .build(),
115 AggregateFunctionSignatureBuilder()
116 .returnType("bigint")
117 .intermediateType("array(bigint)")
118 .argumentType("bigint")
119 .build()};
120 registerDummyAggregateFunction("aggregateFunc1", signatures);
121
122 checkAggregateSignaturesCount("aggregateFunc1_partial", 2);
123 checkAggregateTypeResolution(
124 "aggregateFunc1_partial", {DOUBLE()}, ARRAY(DOUBLE()), ARRAY(DOUBLE()));
125 checkAggregateTypeResolution(
126 "aggregateFunc1_partial", {BIGINT()}, ARRAY(BIGINT()), ARRAY(BIGINT()));
127
128 checkAggregateSignaturesCount("aggregateFunc1_merge", 2);
129 checkAggregateTypeResolution(
130 "aggregateFunc1_merge",
131 {ARRAY(DOUBLE())},
132 ARRAY(DOUBLE()),
133 ARRAY(DOUBLE()));
134 checkAggregateTypeResolution(
135 "aggregateFunc1_merge",
136 {ARRAY(BIGINT())},
137 ARRAY(BIGINT()),
138 ARRAY(BIGINT()));
139
140 checkAggregateSignaturesCount("aggregateFunc1_merge_extract", 2);
141 checkAggregateTypeResolution(
142 "aggregateFunc1_merge_extract",
143 {ARRAY(DOUBLE())},
144 ARRAY(DOUBLE()),
145 DOUBLE());
146 checkAggregateTypeResolution(
147 "aggregateFunc1_merge_extract",
148 {ARRAY(BIGINT())},
149 ARRAY(BIGINT()),
150 BIGINT());
151
152 checkScalarSignaturesCount("aggregateFunc1_extract", 2);
153 checkScalarTypeResolution(
154 "aggregateFunc1_extract", {ARRAY(DOUBLE())}, DOUBLE());
155 checkScalarTypeResolution(
156 "aggregateFunc1_extract", {ARRAY(BIGINT())}, BIGINT());
157}
158
159TEST_F(AggregateCompanionRegistryTest, extractFunctionNameWithSuffix) {
160 std::vector<std::shared_ptr<AggregateFunctionSignature>> signatures{

Callers

nothing calls this directly

Calls 9

ARRAYFunction · 0.85
MAPFunction · 0.85
ROWFunction · 0.85
intermediateTypeMethod · 0.80
registerVectorFunctionFunction · 0.50
signaturesFunction · 0.50
buildMethod · 0.45

Tested by

no test coverage detected