Class OffsetIndexBuilder


  • public class OffsetIndexBuilder
    extends Object
    Builder implementation to create OffsetIndex objects during writing a parquet file.
    • Method Detail

      • getNoOpBuilder

        public static OffsetIndexBuilder getNoOpBuilder()
        Returns:
        a no-op builder that does not collect values and therefore returns null at build(long)
      • add

        public void add​(int compressedPageSize,
                        long rowCount)
        Adds the specified parameters to this builder. Used by the writers to building up OffsetIndex objects to be written to the Parquet file.
        Parameters:
        compressedPageSize - the size of the page (including header)
        rowCount - the number of rows in the page
      • add

        public void add​(long offset,
                        int compressedPageSize,
                        long firstRowIndex)
        Adds the specified parameters to this builder. Used by the metadata converter to building up OffsetIndex objects read from the Parquet file.
        Parameters:
        offset - the offset of the page in the file
        compressedPageSize - the size of the page (including header)
        firstRowIndex - the index of the first row in the page (within the row group)
      • build

        public OffsetIndex build()
        Builds the offset index. Used by the metadata converter to building up OffsetIndex objects read from the Parquet file.
        Returns:
        the newly created offset index or null if the OffsetIndex object would be empty
      • build

        public OffsetIndex build​(long shift)
        Builds the offset index. Used by the writers to building up OffsetIndex objects to be written to the Parquet file.
        Parameters:
        shift - how much to be shifted away
        Returns:
        the newly created offset index or null if the OffsetIndex object would be empty