Class AggregateReader


@Deprecated public class AggregateReader extends ProxyReader
Deprecated.
use GroupByReader instead. GroupByReader provides the same functionality and can return continuous results
A proxy that applies set functions (sum, max, etc.) to fields of records passing through.
  • Constructor Details

    • AggregateReader

      public AggregateReader(DataReader targetDataSource)
      Deprecated.
  • Method Details

    • addExceptionProperties

      public DataException addExceptionProperties(DataException exception)
      Deprecated.
      Description copied from class: Endpoint
      Adds this endpoint's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.
      Overrides:
      addExceptionProperties in class ProxyReader
    • interceptRecord

      protected Record interceptRecord(Record record) throws Throwable
      Deprecated.
      Description copied from class: ProxyReader
      Overridden by subclasses to transform, drop, or observe a record on its way through this proxy.

      Contract for subclasses (see also docs/authoring/ProxyReader.md):

      • Return the record (possibly modified) to pass it downstream.
      • Return null to drop the record; the framework reads the next one.
      • Throw to fail the pipeline; the framework wraps the throwable in a DataException with .setRecord(record).
      • The nested DataReader is opened and closed for you; do not read from it here.
      • Do not call DataEndpoint.incrementRecordCount() here.
      Overrides:
      interceptRecord in class ProxyReader
      Throws:
      Throwable
    • add

      Deprecated.
      Adds operations to apply to each record; an operation replaces any existing one with the same name and field.
    • clear

      public AggregateReader clear()
      Deprecated.
    • reset

      public void reset()
      Deprecated.
      Clears the accumulated result of every operation; called by open().
    • open

      public void open() throws DataException
      Deprecated.
      Description copied from class: DataEndpoint
      Makes this endpoint ready for reading or writing.
      Overrides:
      open in class ProxyReader
      Throws:
      DataException
    • minimum

      public AggregateReader minimum(String fieldName)
      Deprecated.
      Adds an operation tracking the field's smallest value, which becomes null once a null value is read.
    • maximum

      public AggregateReader maximum(String fieldName)
      Deprecated.
      Adds an operation tracking the field's largest non-null value.
    • sum

      public AggregateReader sum(String fieldName)
      Deprecated.
      Adds an operation summing the field's non-null values as a Double.
    • average

      public AggregateReader average(String fieldName)
      Deprecated.
      Adds an operation averaging the field's non-null values as a Double (NaN if there are none).
    • count

      public AggregateReader count(String fieldName)
      Deprecated.
      Adds an operation counting the records whose field is not null.
    • getMinimum

      public Object getMinimum(String fieldName)
      Deprecated.
      Returns the current result of minimum(String) for the field; throws if that operation was not added.
    • getMaximum

      public Object getMaximum(String fieldName)
      Deprecated.
      Returns the current result of maximum(String) for the field; throws if that operation was not added.
    • getSum

      public Object getSum(String fieldName)
      Deprecated.
      Returns the current result of sum(String) for the field; throws if that operation was not added.
    • getAverage

      public Object getAverage(String fieldName)
      Deprecated.
      Returns the current result of average(String) for the field; throws if that operation was not added.
    • getCount

      public Object getCount(String fieldName)
      Deprecated.
      Returns the current result of count(String) for the field; throws if that operation was not added.
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class DataEndpoint