|
69 | 69 | import static org.apache.iotdb.db.queryengine.execution.fragment.FragmentInstanceContext.createFragmentInstanceContext; |
70 | 70 | import static org.apache.iotdb.db.queryengine.execution.operator.AggregationOperatorTest.TEST_TIME_SLICE; |
71 | 71 | import static org.apache.iotdb.db.queryengine.execution.operator.AggregationUtil.initTimeRangeIterator; |
72 | | -import static org.apache.iotdb.db.queryengine.execution.operator.OperatorTestUtils.nextNonNull; |
| 72 | +import static org.apache.iotdb.db.queryengine.execution.operator.OperatorTestUtils.nextNonEmpty; |
73 | 73 | import static org.junit.Assert.assertEquals; |
74 | 74 | import static org.junit.Assert.assertTrue; |
75 | 75 |
|
@@ -123,7 +123,7 @@ public void testAggregationWithoutTimeFilter() throws Exception { |
123 | 123 | initAlignedSeriesAggregationScanOperator(aggregators, null, true, null); |
124 | 124 | int count = 0; |
125 | 125 | while (seriesAggregationScanOperator.hasNext()) { |
126 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 126 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
127 | 127 | for (int i = 0; i < measurementSchemas.size(); i++) { |
128 | 128 | assertEquals(500, resultTsBlock.getColumn(i).getLong(0)); |
129 | 129 | } |
@@ -154,7 +154,7 @@ public void testAggregationWithoutTimeFilterOrderByTimeDesc() throws Exception { |
154 | 154 | initAlignedSeriesAggregationScanOperator(aggregators, null, false, null); |
155 | 155 | int count = 0; |
156 | 156 | while (seriesAggregationScanOperator.hasNext()) { |
157 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 157 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
158 | 158 | for (int i = 0; i < measurementSchemas.size(); i++) { |
159 | 159 | assertEquals(500, resultTsBlock.getColumn(i).getLong(0)); |
160 | 160 | } |
@@ -190,7 +190,7 @@ public void testMultiAggregationFuncWithoutTimeFilter1() throws Exception { |
190 | 190 | initAlignedSeriesAggregationScanOperator(aggregators, null, true, null); |
191 | 191 | int count = 0; |
192 | 192 | while (seriesAggregationScanOperator.hasNext()) { |
193 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 193 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
194 | 194 | assertEquals(500, resultTsBlock.getColumn(0).getLong(0)); |
195 | 195 | assertEquals(6524750.0, resultTsBlock.getColumn(1).getDouble(0), 0.0001); |
196 | 196 | count++; |
@@ -228,7 +228,7 @@ public void testMultiAggregationFuncWithoutTimeFilter2() throws Exception { |
228 | 228 | initAlignedSeriesAggregationScanOperator(aggregators, null, true, null); |
229 | 229 | int count = 0; |
230 | 230 | while (seriesAggregationScanOperator.hasNext()) { |
231 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 231 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
232 | 232 | assertTrue(resultTsBlock.getColumn(0).getBoolean(0)); |
233 | 233 | assertEquals(10499, resultTsBlock.getColumn(1).getInt(0)); |
234 | 234 | assertEquals(20199, resultTsBlock.getColumn(2).getLong(0)); |
@@ -270,7 +270,7 @@ public void testMultiAggregationFuncWithoutTimeFilterOrderByTimeDesc() throws Ex |
270 | 270 | initAlignedSeriesAggregationScanOperator(aggregators, null, false, null); |
271 | 271 | int count = 0; |
272 | 272 | while (seriesAggregationScanOperator.hasNext()) { |
273 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 273 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
274 | 274 | assertTrue(resultTsBlock.getColumn(0).getBoolean(0)); |
275 | 275 | assertEquals(10499, resultTsBlock.getColumn(1).getInt(0)); |
276 | 276 | assertEquals(20199, resultTsBlock.getColumn(2).getLong(0)); |
@@ -305,7 +305,7 @@ public void testAggregationWithTimeFilter1() throws Exception { |
305 | 305 | initAlignedSeriesAggregationScanOperator(aggregators, timeFilter, true, null); |
306 | 306 | int count = 0; |
307 | 307 | while (seriesAggregationScanOperator.hasNext()) { |
308 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 308 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
309 | 309 | for (int i = 0; i < measurementSchemas.size(); i++) { |
310 | 310 | assertEquals(resultTsBlock.getColumn(i).getLong(0), 380); |
311 | 311 | } |
@@ -338,7 +338,7 @@ public void testAggregationWithTimeFilter2() throws Exception { |
338 | 338 | initAlignedSeriesAggregationScanOperator(aggregators, timeFilter, true, null); |
339 | 339 | int count = 0; |
340 | 340 | while (seriesAggregationScanOperator.hasNext()) { |
341 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 341 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
342 | 342 | for (int i = 0; i < measurementSchemas.size(); i++) { |
343 | 343 | assertEquals(resultTsBlock.getColumn(i).getLong(0), 380); |
344 | 344 | } |
@@ -371,7 +371,7 @@ public void testAggregationWithTimeFilter3() throws Exception { |
371 | 371 | initAlignedSeriesAggregationScanOperator(aggregators, timeFilter, true, null); |
372 | 372 | int count = 0; |
373 | 373 | while (seriesAggregationScanOperator.hasNext()) { |
374 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 374 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
375 | 375 | for (int i = 0; i < measurementSchemas.size(); i++) { |
376 | 376 | assertEquals(resultTsBlock.getColumn(i).getLong(0), 300); |
377 | 377 | } |
@@ -411,7 +411,7 @@ public void testMultiAggregationWithTimeFilter() throws Exception { |
411 | 411 | initAlignedSeriesAggregationScanOperator(aggregators, timeFilter, true, null); |
412 | 412 | int count = 0; |
413 | 413 | while (seriesAggregationScanOperator.hasNext()) { |
414 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 414 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
415 | 415 | assertTrue(resultTsBlock.getColumn(0).getBoolean(0)); |
416 | 416 | assertEquals(399, resultTsBlock.getColumn(1).getInt(0)); |
417 | 417 | assertEquals(20199, resultTsBlock.getColumn(2).getLong(0)); |
@@ -449,7 +449,7 @@ public void testGroupByWithoutGlobalTimeFilter() throws Exception { |
449 | 449 | initAlignedSeriesAggregationScanOperator(aggregators, null, true, groupByTimeParameter); |
450 | 450 | int count = 0; |
451 | 451 | while (seriesAggregationScanOperator.hasNext()) { |
452 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 452 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
453 | 453 | int positionCount = resultTsBlock.getPositionCount(); |
454 | 454 | for (int pos = 0; pos < positionCount; pos++) { |
455 | 455 | assertEquals(100 * count, resultTsBlock.getTimeColumn().getLong(pos)); |
@@ -490,7 +490,7 @@ public void testGroupByWithGlobalTimeFilter() throws Exception { |
490 | 490 | aggregators, timeFilter, true, groupByTimeParameter); |
491 | 491 | int count = 0; |
492 | 492 | while (seriesAggregationScanOperator.hasNext()) { |
493 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 493 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
494 | 494 | int positionCount = resultTsBlock.getPositionCount(); |
495 | 495 | for (int pos = 0; pos < positionCount; pos++) { |
496 | 496 | assertEquals(100 * count, resultTsBlock.getTimeColumn().getLong(pos)); |
@@ -535,7 +535,7 @@ public void testGroupByWithMultiFunction() throws Exception { |
535 | 535 | initAlignedSeriesAggregationScanOperator(aggregators, null, true, groupByTimeParameter); |
536 | 536 | int count = 0; |
537 | 537 | while (seriesAggregationScanOperator.hasNext()) { |
538 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 538 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
539 | 539 | int positionCount = resultTsBlock.getPositionCount(); |
540 | 540 | for (int pos = 0; pos < positionCount; pos++) { |
541 | 541 | assertEquals(100 * count, resultTsBlock.getTimeColumn().getLong(pos)); |
@@ -581,7 +581,7 @@ public void testGroupByWithMultiFunctionOrderByTimeDesc() throws Exception { |
581 | 581 | initAlignedSeriesAggregationScanOperator(aggregators, null, false, groupByTimeParameter); |
582 | 582 | int count = 0; |
583 | 583 | while (seriesAggregationScanOperator.hasNext()) { |
584 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 584 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
585 | 585 | int positionCount = resultTsBlock.getPositionCount(); |
586 | 586 | for (int pos = 0; pos < positionCount; pos++) { |
587 | 587 | assertEquals(100 * (3 - count), resultTsBlock.getTimeColumn().getLong(pos)); |
@@ -617,7 +617,7 @@ public void testGroupBySlidingTimeWindow() throws Exception { |
617 | 617 | initAlignedSeriesAggregationScanOperator(aggregators, null, true, groupByTimeParameter); |
618 | 618 | int count = 0; |
619 | 619 | while (seriesAggregationScanOperator.hasNext()) { |
620 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 620 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
621 | 621 | int positionCount = resultTsBlock.getPositionCount(); |
622 | 622 | for (int pos = 0; pos < positionCount; pos++) { |
623 | 623 | assertEquals(50 * count, resultTsBlock.getTimeColumn().getLong(pos)); |
@@ -650,7 +650,7 @@ public void testGroupBySlidingTimeWindow2() throws Exception { |
650 | 650 | initAlignedSeriesAggregationScanOperator(aggregators, null, true, groupByTimeParameter); |
651 | 651 | int count = 0; |
652 | 652 | while (seriesAggregationScanOperator.hasNext()) { |
653 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 653 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
654 | 654 | int positionCount = resultTsBlock.getPositionCount(); |
655 | 655 | for (int pos = 0; pos < positionCount; pos++) { |
656 | 656 | assertEquals(timeColumn[count], resultTsBlock.getTimeColumn().getLong(pos)); |
@@ -694,7 +694,7 @@ public void testGroupBySlidingWindowWithMultiFunction() throws Exception { |
694 | 694 | initAlignedSeriesAggregationScanOperator(aggregators, null, true, groupByTimeParameter); |
695 | 695 | int count = 0; |
696 | 696 | while (seriesAggregationScanOperator.hasNext()) { |
697 | | - TsBlock resultTsBlock = nextNonNull(seriesAggregationScanOperator); |
| 697 | + TsBlock resultTsBlock = nextNonEmpty(seriesAggregationScanOperator); |
698 | 698 | int positionCount = resultTsBlock.getPositionCount(); |
699 | 699 | for (int pos = 0; pos < positionCount; pos++) { |
700 | 700 | assertEquals(timeColumn[count], resultTsBlock.getTimeColumn().getLong(pos)); |
|
0 commit comments