Interface MinMaxNState

All Superinterfaces:
AccumulatorState
All Known Subinterfaces:
MaxNState, MinNState
All Known Implementing Classes:
MinMaxNStateFactory.GroupedMinMaxNState, MinMaxNStateFactory.SingleMinMaxNState

public interface MinMaxNState extends AccumulatorState
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Block block, int position)
    Adds the value to this state.
    void
    deserialize(Block rowBlock)
    Read the state to the specified block builder.
    void
    initialize(long n)
    Initialize the state if not already initialized.
    void
    Merge with the specified state.
    void
    Write this state to the specified block builder.
    void
    Writes all values to the supplied block builder as an array entry.

    Methods inherited from interface io.trino.spi.function.AccumulatorState

    copy, getEstimatedSize
  • Method Details

    • initialize

      void initialize(long n)
      Initialize the state if not already initialized. Only the first call is processed and all subsequent calls are ignored.
    • add

      void add(Block block, int position)
      Adds the value to this state.
    • merge

      void merge(MinMaxNState other)
      Merge with the specified state. The supplied state should not be used after this method is called, because the internal details of the state may be reused in this state.
    • writeAll

      void writeAll(BlockBuilder out)
      Writes all values to the supplied block builder as an array entry.
    • serialize

      void serialize(BlockBuilder out)
      Write this state to the specified block builder.
    • deserialize

      void deserialize(Block rowBlock)
      Read the state to the specified block builder.
      Throws:
      IllegalStateException - if state is already initialized