@Test
  public void testAggregateIntermediateResult2() throws Exception {
    List<TAggregationType> aggregationTypes = new ArrayList<>();
    aggregationTypes.add(TAggregationType.AVG);
    aggregationTypes.add(TAggregationType.FIRST_VALUE);
    aggregationTypes.add(TAggregationType.LAST_VALUE);

    List<List<InputLocation[]>> inputLocations = new ArrayList<>();
    for (int i = 0; i < aggregationTypes.size(); i++) {
      List<InputLocation[]> inputLocationForOneAggregator = new ArrayList<>();
      inputLocationForOneAggregator.add(
          new InputLocation[] {new InputLocation(0, 2 * i), new InputLocation(0, 2 * i + 1)});
      inputLocationForOneAggregator.add(
          new InputLocation[] {new InputLocation(1, 2 * i), new InputLocation(1, 2 * i + 1)});
      inputLocations.add(inputLocationForOneAggregator);
    }

    AggregationOperator aggregationOperator =
        initAggregationOperator(aggregationTypes, null, inputLocations);
    int count = 0;
    while (true) {
      ListenableFuture<?> blocked = aggregationOperator.isBlocked();
      blocked.get();
      if (!aggregationOperator.hasNext()) {
        break;
      }
      TsBlock resultTsBlock = aggregationOperator.next();
      if (resultTsBlock == null) {
        continue;
      }
      assertEquals(13049.5, resultTsBlock.getColumn(0).getDouble(0), 0.001);
      assertEquals(20000, resultTsBlock.getColumn(1).getInt(0));
      assertEquals(10499, resultTsBlock.getColumn(2).getInt(0));
      count++;
    }
    assertEquals(1, count);
  }
Try to aggregate binary intermediate result of one time series without group by interval.
iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/execution/operator/AggregationOperatorTest.java