Class AggregationNode

  • All Implemented Interfaces:
    org.apache.iotdb.consensus.common.request.IConsensusRequest

    public class AggregationNode
    extends MultiChildNode
    This node is used to aggregate required series from multiple sources. The source data will be input as a TsBlock, it may be raw data or partial aggregation result. This node will output the final series aggregated result represented by TsBlock.
    • Method Detail

      • getAggregationDescriptorList

        public java.util.List<AggregationDescriptor> getAggregationDescriptorList()
      • getScanOrder

        public Ordering getScanOrder()
      • getOutputColumnNames

        public java.util.List<java.lang.String> getOutputColumnNames()
        Specified by:
        getOutputColumnNames in class PlanNode
      • setAggregationDescriptorList

        public void setAggregationDescriptorList​(java.util.List<AggregationDescriptor> aggregationDescriptorList)
      • serializeAttributes

        protected void serializeAttributes​(java.nio.ByteBuffer byteBuffer)
        Specified by:
        serializeAttributes in class PlanNode
      • serializeAttributes

        protected void serializeAttributes​(java.io.DataOutputStream stream)
                                    throws java.io.IOException
        Specified by:
        serializeAttributes in class PlanNode
        Throws:
        java.io.IOException
      • deserialize

        public static AggregationNode deserialize​(java.nio.ByteBuffer byteBuffer)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class MultiChildNode
      • getDeduplicatedDescriptors

        public static java.util.List<AggregationDescriptor> getDeduplicatedDescriptors​(java.util.List<AggregationDescriptor> aggregationDescriptors)
        If aggregation function COUNT and AVG for one time series appears at the same time, and outputs intermediate result, the output columns will be like | COUNT | COUNT | SUM |. In this situation, one COUNT column is not needed. Therefore, when COUNT(or SUM) appears with AVG and outputs intermediate result(if they output final result, they will be all necessary), we need to REMOVE the COUNT aggregation, and only keep AVG function no matter their appearing order.

        The related functions include AVG(COUNT AND SUM), FIRST_VALUE(FIRST_VALUE AND MIN_TIME), LAST_VALUE(LAST_VALUE AND MAX_TIME).

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object