Interface AggregationRowLookup


public interface AggregationRowLookup
Tool to identify the aggregation result row key (also row position) from a logical key representing a set of values for the aggregation's group-by columns.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Re-usable unknown row constant to serve as the default return value for noEntryValue().
    static final Object[]
    Re-usable empty key, for use in (trivial) reverse lookups against no-key aggregations.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    get(Object key)
    Gets the row key value where key exists in the aggregation result table, or the noEntryValue() if key is not found in the table.
    default int
     
  • Field Details

    • EMPTY_KEY

      static final Object[] EMPTY_KEY
      Re-usable empty key, for use in (trivial) reverse lookups against no-key aggregations.
    • DEFAULT_UNKNOWN_ROW

      static final int DEFAULT_UNKNOWN_ROW
      Re-usable unknown row constant to serve as the default return value for noEntryValue().
      See Also:
  • Method Details

    • get

      int get(Object key)
      Gets the row key value where key exists in the aggregation result table, or the noEntryValue() if key is not found in the table.

      This serves to map group-by column values to the row position (also row key) in the result table. Missing keys will map to noEntryValue().

      Keys are specified as follows:

      No group-by columns
      "Empty" keys are signified by the EMPTY_KEY object, or any zero-length Object[]
      One group-by column
      Singular keys are (boxed, if needed) objects
      Multiple group-by columns
      Compound keys are Object[] of (boxed, if needed) objects, in the order of the aggregation's group-by columns

      All key fields must be reinterpreted to the appropriate primitive value before boxing. See ReinterpretUtils.maybeConvertToPrimitive(io.deephaven.engine.table.ColumnSource<?>).

      Parameters:
      key - A single (boxed) value for single-column keys, or an array of (boxed) values for compound keys
      Returns:
      The row key where key exists in the table
    • noEntryValue

      default int noEntryValue()
      Returns:
      The value that will be returned from get(Object) if no entry exists for a given key