Record Class ColumnIndex

java.lang.Object
java.lang.Record
dev.hardwood.metadata.ColumnIndex
Record Components:
nullPages - one flag per page, set for a page that contains only null values
minValues - per-page minimum values in the column's physical sort order
maxValues - per-page maximum values in the column's physical sort order
boundaryOrder - ordering of min/max values: UNORDERED, ASCENDING, or DESCENDING
nullCounts - per-page null counts, or null if not available
repetitionLevelHistograms - per-page repetition-level histograms concatenated page-major, or null if not available. See the note on layout above
definitionLevelHistograms - per-page definition-level histograms concatenated page-major, or null if not available
nanCounts - per-page NaN counts, or null if not available. Only meaningful for FLOAT, DOUBLE and FLOAT16 columns, whose NaN values sit outside the ordering of minValues/maxValues

public record ColumnIndex(boolean[] nullPages, List<byte[]> minValues, List<byte[]> maxValues, ColumnIndex.BoundaryOrder boundaryOrder, long[] nullCounts, long[] repetitionLevelHistograms, long[] definitionLevelHistograms, long[] nanCounts) extends Record

Column index for a column chunk, providing per-page min/max statistics for page-level filtering.

The level histograms hold one histogram per page, concatenated into a single array in page order: with maxLevel + 1 entries per page, page p occupies the range from p * (maxLevel + 1) up to (p + 1) * (maxLevel + 1). repetitionLevelHistogram(int) and definitionLevelHistogram(int) slice one page out.

The per-page arrays are the values as the file recorded them and are not copied on the way in or out. An absent optional array is null, which stays distinct from a zero-length one the writer recorded as empty.

See Also:
  • Constructor Details

    • ColumnIndex

      public ColumnIndex(boolean[] nullPages, List<byte[]> minValues, List<byte[]> maxValues, ColumnIndex.BoundaryOrder boundaryOrder, long[] nullCounts, long[] repetitionLevelHistograms, long[] definitionLevelHistograms, long[] nanCounts)
      Creates an instance of a ColumnIndex record class.
      Parameters:
      nullPages - the value for the nullPages record component
      minValues - the value for the minValues record component
      maxValues - the value for the maxValues record component
      boundaryOrder - the value for the boundaryOrder record component
      nullCounts - the value for the nullCounts record component
      repetitionLevelHistograms - the value for the repetitionLevelHistograms record component
      definitionLevelHistograms - the value for the definitionLevelHistograms record component
      nanCounts - the value for the nanCounts record component
  • Method Details

    • getPageCount

      public int getPageCount()
      Returns the number of pages described by this index.
    • repetitionLevelHistogram

      public long[] repetitionLevelHistogram(int pageIndex)
      Returns one page's slice of repetitionLevelHistograms(), or null if the file records no repetition-level histogram for this chunk.
      Parameters:
      pageIndex - page to slice, in [0, getPageCount())
      Throws:
      IndexOutOfBoundsException - if pageIndex is outside that range
      IllegalStateException - if the histogram's length is not a whole number of pages, so no per-page stride describes it
    • definitionLevelHistogram

      public long[] definitionLevelHistogram(int pageIndex)
      Returns one page's slice of definitionLevelHistograms(), or null if the file records no definition-level histogram for this chunk.
      Parameters:
      pageIndex - page to slice, in [0, getPageCount())
      Throws:
      IndexOutOfBoundsException - if pageIndex is outside that range
      IllegalStateException - if the histogram's length is not a whole number of pages, so no per-page stride describes it
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • nullPages

      public boolean[] nullPages()
      Returns the value of the nullPages record component.
      Returns:
      the value of the nullPages record component
    • minValues

      public List<byte[]> minValues()
      Returns the value of the minValues record component.
      Returns:
      the value of the minValues record component
    • maxValues

      public List<byte[]> maxValues()
      Returns the value of the maxValues record component.
      Returns:
      the value of the maxValues record component
    • boundaryOrder

      public ColumnIndex.BoundaryOrder boundaryOrder()
      Returns the value of the boundaryOrder record component.
      Returns:
      the value of the boundaryOrder record component
    • nullCounts

      public long[] nullCounts()
      Returns the value of the nullCounts record component.
      Returns:
      the value of the nullCounts record component
    • repetitionLevelHistograms

      public long[] repetitionLevelHistograms()
      Returns the value of the repetitionLevelHistograms record component.
      Returns:
      the value of the repetitionLevelHistograms record component
    • definitionLevelHistograms

      public long[] definitionLevelHistograms()
      Returns the value of the definitionLevelHistograms record component.
      Returns:
      the value of the definitionLevelHistograms record component
    • nanCounts

      public long[] nanCounts()
      Returns the value of the nanCounts record component.
      Returns:
      the value of the nanCounts record component