|
15 | 15 | import org.elasticsearch.compute.aggregation.SumLongAggregatorFunctionSupplier; |
16 | 16 | import org.elasticsearch.compute.aggregation.SumLongGroupingAggregatorFunctionTests; |
17 | 17 | import org.elasticsearch.compute.aggregation.blockhash.BlockHash; |
18 | | -import org.elasticsearch.compute.aggregation.blockhash.LongTopNBlockHash; |
19 | 18 | import org.elasticsearch.compute.data.Block; |
20 | 19 | import org.elasticsearch.compute.data.BlockFactory; |
21 | 20 | import org.elasticsearch.compute.data.BlockUtils; |
@@ -113,14 +112,16 @@ public void testTopNNullsLast() { |
113 | 112 | var aggregatorChannels = List.of(1); |
114 | 113 |
|
115 | 114 | try ( |
116 | | - var operator = new HashAggregationOperator( |
| 115 | + var operator = new HashAggregationOperator.HashAggregationOperatorFactory( |
| 116 | + List.of(new BlockHash.GroupSpec(groupChannel, ElementType.LONG, false, new BlockHash.TopNDef(0, ascOrder, false, 3))), |
| 117 | + mode, |
117 | 118 | List.of( |
118 | 119 | new SumLongAggregatorFunctionSupplier().groupingAggregatorFactory(mode, aggregatorChannels), |
119 | 120 | new MaxLongAggregatorFunctionSupplier().groupingAggregatorFactory(mode, aggregatorChannels) |
120 | 121 | ), |
121 | | - () -> new LongTopNBlockHash(groupChannel, ascOrder, false, 3, blockFactory()), |
122 | | - driverContext() |
123 | | - ) |
| 122 | + randomPageSize(), |
| 123 | + null |
| 124 | + ).get(driverContext()) |
124 | 125 | ) { |
125 | 126 | var page = new Page( |
126 | 127 | BlockUtils.fromList( |
@@ -188,14 +189,16 @@ public void testTopNNullsFirst() { |
188 | 189 | var aggregatorChannels = List.of(1); |
189 | 190 |
|
190 | 191 | try ( |
191 | | - var operator = new HashAggregationOperator( |
| 192 | + var operator = new HashAggregationOperator.HashAggregationOperatorFactory( |
| 193 | + List.of(new BlockHash.GroupSpec(groupChannel, ElementType.LONG, false, new BlockHash.TopNDef(0, ascOrder, true, 3))), |
| 194 | + mode, |
192 | 195 | List.of( |
193 | 196 | new SumLongAggregatorFunctionSupplier().groupingAggregatorFactory(mode, aggregatorChannels), |
194 | 197 | new MaxLongAggregatorFunctionSupplier().groupingAggregatorFactory(mode, aggregatorChannels) |
195 | 198 | ), |
196 | | - () -> new LongTopNBlockHash(groupChannel, ascOrder, true, 3, blockFactory()), |
197 | | - driverContext() |
198 | | - ) |
| 199 | + randomPageSize(), |
| 200 | + null |
| 201 | + ).get(driverContext()) |
199 | 202 | ) { |
200 | 203 | var page = new Page( |
201 | 204 | BlockUtils.fromList( |
|
0 commit comments