Class ColumnIndexBuilder

java.lang.Object
org.apache.parquet.internal.column.columnindex.ColumnIndexBuilder

public abstract class ColumnIndexBuilder extends Object
Builder implementation to create ColumnIndex objects.
  • Method Details

    • getNoOpBuilder

      public static ColumnIndexBuilder getNoOpBuilder()
      Returns:
      a no-op builder that does not collect statistics objects and therefore returns null at build().
    • getBuilder

      public static ColumnIndexBuilder getBuilder(PrimitiveType type, int truncateLength)
      Parameters:
      type - the type this builder is to be created for
      truncateLength - the length to be used for truncating binary values if possible
      Returns:
      a ColumnIndexBuilder instance to be used for creating ColumnIndex objects
    • build

      public static ColumnIndex build(PrimitiveType type, BoundaryOrder boundaryOrder, List<Boolean> nullPages, List<Long> nullCounts, List<ByteBuffer> minValues, List<ByteBuffer> maxValues)
      Parameters:
      type - the primitive type
      boundaryOrder - the boundary order of the min/max values
      nullPages - the null pages (one boolean value for each page that signifies whether the page consists of nulls entirely)
      nullCounts - the number of null values for each page
      minValues - the min values for each page
      maxValues - the max values for each page
      Returns:
      the newly created ColumnIndex object based on the specified arguments
    • build

      public static ColumnIndex build(PrimitiveType type, BoundaryOrder boundaryOrder, List<Boolean> nullPages, List<Long> nullCounts, List<ByteBuffer> minValues, List<ByteBuffer> maxValues, List<Long> repLevelHistogram, List<Long> defLevelHistogram)
      Parameters:
      type - the primitive type
      boundaryOrder - the boundary order of the min/max values
      nullPages - the null pages (one boolean value for each page that signifies whether the page consists of nulls entirely)
      nullCounts - the number of null values for each page
      minValues - the min values for each page
      maxValues - the max values for each page
      repLevelHistogram - the repetition level histogram for all levels of each page
      defLevelHistogram - the definition level histogram for all levels of each page
      Returns:
      the newly created ColumnIndex object based on the specified arguments
    • build

      public static ColumnIndex build(PrimitiveType type, BoundaryOrder boundaryOrder, List<Boolean> nullPages, List<Long> nullCounts, List<Long> nanCounts, List<ByteBuffer> minValues, List<ByteBuffer> maxValues, List<Long> repLevelHistogram, List<Long> defLevelHistogram)
      Parameters:
      type - the primitive type
      boundaryOrder - the boundary order of the min/max values
      nullPages - the null pages (one boolean value for each page that signifies whether the page consists of nulls entirely)
      nullCounts - the number of null values for each page
      nanCounts - the number of NaN values for each page (may be null)
      minValues - the min values for each page
      maxValues - the max values for each page
      repLevelHistogram - the repetition level histogram for all levels of each page
      defLevelHistogram - the definition level histogram for all levels of each page
      Returns:
      the newly created ColumnIndex object based on the specified arguments
    • add

      public void add(Statistics<?> stats)
      Adds the data from the specified statistics to this builder
      Parameters:
      stats - the statistics to be added
    • add

      public void add(Statistics<?> stats, SizeStatistics sizeStats)
      Adds the data from the specified statistics to this builder
      Parameters:
      stats - the statistics to be added
      sizeStats - the size statistics to be added
    • build

      public ColumnIndex build()
      Returns:
      the newly created column index or null if the ColumnIndex would be empty
    • getPageCount

      public int getPageCount()
      Returns:
      the number of pages added so far to this builder
    • getMinMaxSize

      public long getMinMaxSize()
      Returns:
      the sum of size in bytes of the min/max values added so far to this builder