Class OffsetIndexBuilder
java.lang.Object
org.apache.parquet.internal.column.columnindex.OffsetIndexBuilder
Builder implementation to create
OffsetIndex objects during writing a parquet file.-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int compressedPageSize, long rowCount) Adds the specified parameters to this builder.voidAdds the specified parameters to this builder.voidadd(long offset, int compressedPageSize, long firstRowIndex) Adds the specified parameters to this builder.voidAdds the specified parameters to this builder.build()Builds the offset index.build(long shift) Builds the offset index.fromOffsetIndex(OffsetIndex offsetIndex) static OffsetIndexBuilderstatic OffsetIndexBuilder
-
Method Details
-
getNoOpBuilder
- Returns:
- a no-op builder that does not collect values and therefore returns
nullatbuild(long)
-
getBuilder
- Returns:
- an
OffsetIndexBuilderinstance to build anOffsetIndexobject
-
add
public void add(int compressedPageSize, long rowCount) Adds the specified parameters to this builder. Used by the writers to building upOffsetIndexobjects 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
Adds the specified parameters to this builder. Used by the writers to building upOffsetIndexobjects to be written to the Parquet file.- Parameters:
compressedPageSize- the size of the page (including header)rowCount- the number of rows in the pageunencodedDataBytes- the number of bytes of unencoded data of BYTE_ARRAY type
-
add
public void add(long offset, int compressedPageSize, long firstRowIndex) Adds the specified parameters to this builder. Used by the metadata converter to building upOffsetIndexobjects read from the Parquet file.- Parameters:
offset- the offset of the page in the filecompressedPageSize- the size of the page (including header)firstRowIndex- the index of the first row in the page (within the row group)
-
add
public void add(long offset, int compressedPageSize, long firstRowIndex, Optional<Long> unencodedDataBytes) Adds the specified parameters to this builder. Used by the metadata converter to building upOffsetIndexobjects read from the Parquet file.- Parameters:
offset- the offset of the page in the filecompressedPageSize- the size of the page (including header)firstRowIndex- the index of the first row in the page (within the row group)unencodedDataBytes- the number of bytes of unencoded data of BYTE_ARRAY type
-
build
Builds the offset index. Used by the metadata converter to building upOffsetIndexobjects read from the Parquet file.- Returns:
- the newly created offset index or
nullif theOffsetIndexobject would be empty
-
fromOffsetIndex
-
build
Builds the offset index. Used by the writers to building upOffsetIndexobjects to be written to the Parquet file.- Parameters:
shift- how much to be shifted away- Returns:
- the newly created offset index or
nullif theOffsetIndexobject would be empty
-