| 106 | }; |
| 107 | |
| 108 | TEST_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 | |
| 159 | TEST_F(AggregateCompanionRegistryTest, extractFunctionNameWithSuffix) { |
| 160 | std::vector<std::shared_ptr<AggregateFunctionSignature>> signatures{ |
nothing calls this directly
no test coverage detected