Interface ApproximateAwareAccumulator

All Known Implementing Classes:
AvgAccumulator, MedianAccumulator, PercentileContAccumulator, StdDevAccumulator, StdDevPopAccumulator, SumAccumulator, VarianceAccumulator, VarPopAccumulator

public interface ApproximateAwareAccumulator
An accumulator whose result depends on whether its argument is APPROXIMATE, which the values alone cannot always say. A FLOAT column holds a double, but a FLOAT-declared expression can still reach an accumulator in an exact carrier — a value computed exactly, or one restored from an older snapshot — and then a 1.5 from a FLOAT and a 1.5 from a NUMBER(2,1) are the same object; only the declared type separates them.

The distinction decides a real difference: an interpolating percentile over an exact column adds three decimals to its scale, while over a FLOAT there is no scale to add to and live answers the plain double. Without this the FLOAT answer came back padded — 2.5000 for a live 2.5.

The caller sets the flag once, after building the accumulator and before feeding it.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setApproximateArgument(boolean approximate)
    Tell the accumulator what its argument's declared type is.
  • Method Details

    • setApproximateArgument

      void setApproximateArgument(boolean approximate)
      Tell the accumulator what its argument's declared type is.
      Parameters:
      approximate - whether the aggregated expression is declared FLOAT / DOUBLE / REAL