Class OffsetIndexBuilder
- java.lang.Object
-
- org.apache.parquet.internal.column.columnindex.OffsetIndexBuilder
-
public class OffsetIndexBuilder extends Object
Builder implementation to createOffsetIndexobjects during writing a parquet file.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int compressedPageSize, long rowCount)Adds the specified parameters to this builder.voidadd(int compressedPageSize, long rowCount, Optional<Long> unencodedDataBytes)Adds the specified parameters to this builder.voidadd(long offset, int compressedPageSize, long firstRowIndex)Adds the specified parameters to this builder.voidadd(long offset, int compressedPageSize, long firstRowIndex, Optional<Long> unencodedDataBytes)Adds the specified parameters to this builder.OffsetIndexbuild()Builds the offset index.OffsetIndexbuild(long shift)Builds the offset index.OffsetIndexBuilderfromOffsetIndex(OffsetIndex offsetIndex)static OffsetIndexBuildergetBuilder()static OffsetIndexBuildergetNoOpBuilder()
-
-
-
Method Detail
-
getNoOpBuilder
public static OffsetIndexBuilder getNoOpBuilder()
- Returns:
- a no-op builder that does not collect values and therefore returns
nullatbuild(long)
-
getBuilder
public static OffsetIndexBuilder 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
public void add(int compressedPageSize, long rowCount, Optional<Long> unencodedDataBytes)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
public OffsetIndex 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
public OffsetIndexBuilder fromOffsetIndex(OffsetIndex offsetIndex)
-
build
public OffsetIndex build(long shift)
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
-
-