Class AggregationUtil


  • public class AggregationUtil
    extends java.lang.Object
    • Method Detail

      • initTimeRangeIterator

        public static ITimeRangeIterator initTimeRangeIterator​(GroupByTimeParameter groupByTimeParameter,
                                                               boolean ascending,
                                                               boolean outputPartialTimeWindow)
        If groupByTimeParameter is null, which means it's an aggregation query without down sampling. Aggregation query has only one time window and the result set of it does not contain a timestamp, so it doesn't matter what the time range returns.
      • calculateAggregationFromRawData

        public static org.apache.iotdb.tsfile.utils.Pair<java.lang.Boolean,​org.apache.iotdb.tsfile.read.common.block.TsBlock> calculateAggregationFromRawData​(org.apache.iotdb.tsfile.read.common.block.TsBlock inputTsBlock,
                                                                                                                                                                    java.util.List<Aggregator> aggregators,
                                                                                                                                                                    org.apache.iotdb.tsfile.read.common.TimeRange curTimeRange,
                                                                                                                                                                    boolean ascending)
        Calculate aggregation value on the time range from the tsBlock containing raw data.
        Returns:
        left - whether the aggregation calculation of the current time range has done; right - remaining tsBlock
      • appendAggregationResult

        public static void appendAggregationResult​(org.apache.iotdb.tsfile.read.common.block.TsBlockBuilder tsBlockBuilder,
                                                   java.util.List<? extends Aggregator> aggregators,
                                                   ITimeRangeIterator timeRangeIterator)
        Append a row of aggregation results to the result tsBlock.
      • satisfiedTimeRange

        public static boolean satisfiedTimeRange​(org.apache.iotdb.tsfile.read.common.block.TsBlock tsBlock,
                                                 org.apache.iotdb.tsfile.read.common.TimeRange curTimeRange,
                                                 boolean ascending)
        Returns:
        whether the tsBlock contains the data of the current time window
      • isAllAggregatorsHasFinalResult

        public static boolean isAllAggregatorsHasFinalResult​(java.util.List<Aggregator> aggregators)
      • calculateMaxAggregationResultSizeForLastQuery

        public static long calculateMaxAggregationResultSizeForLastQuery​(java.util.List<Aggregator> aggregators,
                                                                         org.apache.iotdb.commons.path.PartialPath inputSeriesPath)