| 53 | }; |
| 54 | |
| 55 | TEST_F(SimpleAverageAggregationTest, averageAggregate) { |
| 56 | auto inputVectors = makeRowVector( |
| 57 | {makeFlatVector<bool>( |
| 58 | {true, |
| 59 | false, |
| 60 | true, |
| 61 | false, |
| 62 | true, |
| 63 | false, |
| 64 | true, |
| 65 | false, |
| 66 | true, |
| 67 | false, |
| 68 | true, |
| 69 | false}), |
| 70 | makeFlatVector<bool>( |
| 71 | {true, |
| 72 | true, |
| 73 | true, |
| 74 | true, |
| 75 | true, |
| 76 | true, |
| 77 | true, |
| 78 | true, |
| 79 | true, |
| 80 | true, |
| 81 | false, |
| 82 | false}), |
| 83 | makeNullableFlatVector<int64_t>( |
| 84 | {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, std::nullopt, std::nullopt}), |
| 85 | makeNullableFlatVector<double>( |
| 86 | {1.1, |
| 87 | 2.2, |
| 88 | 3.3, |
| 89 | 4.4, |
| 90 | 5.5, |
| 91 | 6.6, |
| 92 | 7.7, |
| 93 | 8.8, |
| 94 | 9.9, |
| 95 | 11, |
| 96 | std::nullopt, |
| 97 | std::nullopt})}); |
| 98 | |
| 99 | auto expected = makeRowVector( |
| 100 | {makeFlatVector<bool>({true, false}), |
| 101 | makeFlatVector<double>({5, 6}), |
| 102 | makeFlatVector<double>({5.5, 6.6})}); |
| 103 | testAggregations( |
| 104 | {inputVectors}, {"c0"}, {"simple_avg(c2)", "simple_avg(c3)"}, {expected}); |
| 105 | |
| 106 | expected = makeRowVector( |
| 107 | {makeFlatVector<bool>({true, false}), |
| 108 | makeNullableFlatVector<double>({5.5, std::nullopt}), |
| 109 | makeNullableFlatVector<double>({6.05, std::nullopt})}); |
| 110 | testAggregations( |
| 111 | {inputVectors}, {"c1"}, {"simple_avg(c2)", "simple_avg(c3)"}, {expected}); |
| 112 |
nothing calls this directly
no test coverage detected