Skip to content

AggregateProcessor

AggregateProcessor is used by WindowExecBase unary physical operators when requested for windowFrameExpressionFactoryPairs to create the following WindowFunctionFrames (for supported AGGREGATE functions):

  • SlidingWindowFunctionFrame
  • UnboundedFollowingWindowFunctionFrame
  • UnboundedPrecedingWindowFunctionFrame
  • UnboundedWindowFunctionFrame

Supported AGGREGATE Functions

AggregateProcessor is used for the following AGGREGATE functions:

Creating Instance

AggregateProcessor takes the following to be created:

  • Buffer Schema (Array[AttributeReference])
  • Initial MutableProjection
  • Update MutableProjection
  • Evaluate MutableProjection
  • ImperativeAggregate
  • trackPartitionSize flag

AggregateProcessor is created using apply factory.

Creating AggregateProcessor Instance

apply(
  functions: Array[Expression],
  ordinal: Int,
  inputAttributes: Seq[Attribute],
  newMutableProjection: (Seq[Expression], Seq[Attribute]) => MutableProjection
): AggregateProcessor

apply creates an AggregateProcessor.

apply is used when:

evaluate

evaluate(
  target: InternalRow): Unit

evaluate...FIXME

evaluate is used when:

  • SlidingWindowFunctionFrame is requested to write
  • UnboundedFollowingWindowFunctionFrame is requested to write
  • UnboundedPrecedingWindowFunctionFrame is requested to write
  • UnboundedWindowFunctionFrame is requested to prepare

initialize

initialize(
  size: Int): Unit

initialize...FIXME

initialize is used when:

  • SlidingWindowFunctionFrame is requested to write
  • UnboundedFollowingWindowFunctionFrame is requested to write
  • UnboundedPrecedingWindowFunctionFrame is requested to prepare
  • UnboundedWindowFunctionFrame is requested to prepare

update

update(
  input: InternalRow): Unit

update...FIXME

update is used when:

  • SlidingWindowFunctionFrame is requested to write
  • UnboundedFollowingWindowFunctionFrame is requested to write
  • UnboundedPrecedingWindowFunctionFrame is requested to write
  • UnboundedWindowFunctionFrame is requested to prepare