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 valuesminValues- per-page minimum values in the column's physical sort ordermaxValues- per-page maximum values in the column's physical sort orderboundaryOrder- ordering of min/max values: UNORDERED, ASCENDING, or DESCENDINGnullCounts- per-page null counts, ornullif not availablerepetitionLevelHistograms- per-page repetition-level histograms concatenated page-major, ornullif not available. See the note on layout abovedefinitionLevelHistograms- per-page definition-level histograms concatenated page-major, ornullif not availablenanCounts- per-page NaN counts, ornullif not available. Only meaningful forFLOAT,DOUBLEandFLOAT16columns, whose NaN values sit outside the ordering ofminValues/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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumOrdering of min/max values across pages. -
Constructor Summary
ConstructorsConstructorDescriptionColumnIndex(boolean[] nullPages, List<byte[]> minValues, List<byte[]> maxValues, ColumnIndex.BoundaryOrder boundaryOrder, long[] nullCounts, long[] repetitionLevelHistograms, long[] definitionLevelHistograms, long[] nanCounts) Creates an instance of aColumnIndexrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theboundaryOrderrecord component.long[]definitionLevelHistogram(int pageIndex) Returns one page's slice ofdefinitionLevelHistograms(), ornullif the file records no definition-level histogram for this chunk.long[]Returns the value of thedefinitionLevelHistogramsrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the number of pages described by this index.final inthashCode()Returns a hash code value for this object.List<byte[]> Returns the value of themaxValuesrecord component.List<byte[]> Returns the value of theminValuesrecord component.long[]Returns the value of thenanCountsrecord component.long[]Returns the value of thenullCountsrecord component.boolean[]Returns the value of thenullPagesrecord component.long[]repetitionLevelHistogram(int pageIndex) Returns one page's slice ofrepetitionLevelHistograms(), ornullif the file records no repetition-level histogram for this chunk.long[]Returns the value of therepetitionLevelHistogramsrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aColumnIndexrecord class.- Parameters:
nullPages- the value for thenullPagesrecord componentminValues- the value for theminValuesrecord componentmaxValues- the value for themaxValuesrecord componentboundaryOrder- the value for theboundaryOrderrecord componentnullCounts- the value for thenullCountsrecord componentrepetitionLevelHistograms- the value for therepetitionLevelHistogramsrecord componentdefinitionLevelHistograms- the value for thedefinitionLevelHistogramsrecord componentnanCounts- the value for thenanCountsrecord 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 ofrepetitionLevelHistograms(), ornullif the file records no repetition-level histogram for this chunk.- Parameters:
pageIndex- page to slice, in[0, getPageCount())- Throws:
IndexOutOfBoundsException- ifpageIndexis outside that rangeIllegalStateException- 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 ofdefinitionLevelHistograms(), ornullif the file records no definition-level histogram for this chunk.- Parameters:
pageIndex- page to slice, in[0, getPageCount())- Throws:
IndexOutOfBoundsException- ifpageIndexis outside that rangeIllegalStateException- if the histogram's length is not a whole number of pages, so no per-page stride describes it
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
nullPages
-
minValues
-
maxValues
-
boundaryOrder
Returns the value of theboundaryOrderrecord component.- Returns:
- the value of the
boundaryOrderrecord component
-
nullCounts
public long[] nullCounts()Returns the value of thenullCountsrecord component.- Returns:
- the value of the
nullCountsrecord component
-
repetitionLevelHistograms
public long[] repetitionLevelHistograms()Returns the value of therepetitionLevelHistogramsrecord component.- Returns:
- the value of the
repetitionLevelHistogramsrecord component
-
definitionLevelHistograms
public long[] definitionLevelHistograms()Returns the value of thedefinitionLevelHistogramsrecord component.- Returns:
- the value of the
definitionLevelHistogramsrecord component
-
nanCounts
-