Class AbstractListaggAggregationState

java.lang.Object
io.trino.operator.aggregation.listagg.AbstractListaggAggregationState
All Implemented Interfaces:
ListaggAggregationState, AccumulatorState
Direct Known Subclasses:
GroupListaggAggregationState, SingleListaggAggregationState

public abstract class AbstractListaggAggregationState extends Object implements ListaggAggregationState
  • Field Details

    • RECORDS_PER_GROUP

      protected static final int RECORDS_PER_GROUP
      See Also:
    • RECORDS_PER_GROUP_MASK

      protected static final int RECORDS_PER_GROUP_MASK
      See Also:
    • recordSize

      protected final int recordSize
    • closedRecordGroups

      protected final List<byte[]> closedRecordGroups
      The fixed chunk contains an array of records. The records are laid out as follows:
      • 12 byte pointer to variable width data
      • 8 byte next index (only present if hasNextIndex is true)
      The pointer is placed first to simplify the offset calculations for variable with code. This chunk contains capacity + 1 records. The extra record is used for the swap operation.
    • openRecordGroup

      protected byte[] openRecordGroup
  • Constructor Details

    • AbstractListaggAggregationState

      public AbstractListaggAggregationState(int extraRecordBytes)
    • AbstractListaggAggregationState

      public AbstractListaggAggregationState(AbstractListaggAggregationState state)
  • Method Details

    • getEstimatedSize

      public long getEstimatedSize()
      Specified by:
      getEstimatedSize in interface AccumulatorState
    • size

      protected final long size()
    • initialize

      public final void initialize(io.airlift.slice.Slice separator, boolean overflowError, io.airlift.slice.Slice overflowFiller, boolean showOverflowEntryCount)
      Specified by:
      initialize in interface ListaggAggregationState
    • add

      public void add(ValueBlock block, int position)
      Specified by:
      add in interface ListaggAggregationState
    • serialize

      public void serialize(RowBlockBuilder rowBlockBuilder)
      Specified by:
      serialize in interface ListaggAggregationState
    • merge

      public void merge(ListaggAggregationState other)
      Specified by:
      merge in interface ListaggAggregationState
    • writeEntry

      protected final boolean writeEntry(byte[] records, int recordOffset, io.airlift.slice.SliceOutput out, int totalEntryCount, int emittedCount)
    • getRecords

      protected final byte[] getRecords(long index)
    • getRecordOffset

      protected final int getRecordOffset(long index)