Package org.apache.iceberg
Class Metrics
java.lang.Object
org.apache.iceberg.Metrics
- All Implemented Interfaces:
Serializable
Iceberg file format metrics.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMetrics()Creates an empty metrics instance with no statistics set.Metrics(long rowCount) Creates a new metrics instance with only the row count set.Metrics(Long rowCount, Map<Integer, Long> columnSizes, Map<Integer, Long> valueCounts, Map<Integer, Long> nullValueCounts, Map<Integer, Long> nanValueCounts) Creates a new metrics instance.Metrics(Long rowCount, Map<Integer, Long> columnSizes, Map<Integer, Long> valueCounts, Map<Integer, Long> nullValueCounts, Map<Integer, Long> nanValueCounts, Map<Integer, ByteBuffer> lowerBounds, Map<Integer, ByteBuffer> upperBounds) Creates a new metrics instance.Metrics(Long rowCount, Map<Integer, Long> columnSizes, Map<Integer, Long> valueCounts, Map<Integer, Long> nullValueCounts, Map<Integer, Long> nanValueCounts, Map<Integer, ByteBuffer> lowerBounds, Map<Integer, ByteBuffer> upperBounds, Map<Integer, Integer> avgValueSizes, Map<Integer, Type> originalTypes) Creates a new metrics instance.Metrics(Long rowCount, Map<Integer, Long> columnSizes, Map<Integer, Long> valueCounts, Map<Integer, Long> nullValueCounts, Map<Integer, Long> nanValueCounts, Map<Integer, ByteBuffer> lowerBounds, Map<Integer, ByteBuffer> upperBounds, Map<Integer, Type> originalTypes) Creates a new metrics instance. -
Method Summary
Modifier and TypeMethodDescriptionGet the average value size in memory (uncompressed) in bytes over non-null values, for all fields where it was collected.Get the number of bytes for all fields in a file.Get the non-null lower bound values for all fields in a file.Get the number of NaN values for all float and double fields in a file.Get the number of null values for all fields in a file.Get the number of records (rows) in file.Get the non-null upper bound values for all fields in a file.Get the number of all values, including nulls, NaN and repeated.
-
Constructor Details
-
Metrics
public Metrics()Creates an empty metrics instance with no statistics set. -
Metrics
public Metrics(long rowCount) Creates a new metrics instance with only the row count set.- Parameters:
rowCount- the number of rows (records) in the file
-
Metrics
public Metrics(Long rowCount, Map<Integer, Long> columnSizes, Map<Integer, Long> valueCounts, Map<Integer, Long> nullValueCounts, Map<Integer, Long> nanValueCounts) Creates a new metrics instance.- Parameters:
rowCount- the number of rows (records) in the file, or null if unknowncolumnSizes- a map of field id to the size in bytes of the column, or null if unknownvalueCounts- a map of field id to the number of all values (including nulls, NaN, and repeated), or null if unknownnullValueCounts- a map of field id to the number of null values, or null if unknownnanValueCounts- a map of field id to the number of NaN values, or null if unknown
-
Metrics
public Metrics(Long rowCount, Map<Integer, Long> columnSizes, Map<Integer, Long> valueCounts, Map<Integer, Long> nullValueCounts, Map<Integer, Long> nanValueCounts, Map<Integer, ByteBuffer> lowerBounds, Map<Integer, ByteBuffer> upperBounds) Creates a new metrics instance.- Parameters:
rowCount- the number of rows (records) in the file, or null if unknowncolumnSizes- a map of field id to the size in bytes of the column, or null if unknownvalueCounts- a map of field id to the number of all values (including nulls, NaN, and repeated), or null if unknownnullValueCounts- a map of field id to the number of null values, or null if unknownnanValueCounts- a map of field id to the number of NaN values, or null if unknownlowerBounds- a map of field id to the lower bound of the column, or null if unknownupperBounds- a map of field id to the upper bound of the column, or null if unknown
-
Metrics
public Metrics(Long rowCount, Map<Integer, Long> columnSizes, Map<Integer, Long> valueCounts, Map<Integer, Long> nullValueCounts, Map<Integer, Long> nanValueCounts, Map<Integer, ByteBuffer> lowerBounds, Map<Integer, ByteBuffer> upperBounds, Map<Integer, Type> originalTypes) Creates a new metrics instance.- Parameters:
rowCount- the number of rows (records) in the file, or null if unknowncolumnSizes- a map of field id to the size in bytes of the column, or null if unknownvalueCounts- a map of field id to the number of all values (including nulls, NaN, and repeated), or null if unknownnullValueCounts- a map of field id to the number of null values, or null if unknownnanValueCounts- a map of field id to the number of NaN values, or null if unknownlowerBounds- a map of field id to the lower bound of the column, or null if unknownupperBounds- a map of field id to the upper bound of the column, or null if unknownoriginalTypes- a map of field id to the original type of the lower/upper bound, or null if unknown
-
Metrics
public Metrics(Long rowCount, Map<Integer, Long> columnSizes, Map<Integer, Long> valueCounts, Map<Integer, Long> nullValueCounts, Map<Integer, Long> nanValueCounts, Map<Integer, ByteBuffer> lowerBounds, Map<Integer, ByteBuffer> upperBounds, Map<Integer, Integer> avgValueSizes, Map<Integer, Type> originalTypes) Creates a new metrics instance.- Parameters:
rowCount- the number of rows (records) in the file, or null if unknowncolumnSizes- a map of field id to the size in bytes of the column, or null if unknownvalueCounts- a map of field id to the number of all values (including nulls, NaN, and repeated), or null if unknownnullValueCounts- a map of field id to the number of null values, or null if unknownnanValueCounts- a map of field id to the number of NaN values, or null if unknownlowerBounds- a map of field id to the lower bound of the column, or null if unknownupperBounds- a map of field id to the upper bound of the column, or null if unknownavgValueSizes- a map of field id to the average size in bytes of the column's non-null values, or null if unknownoriginalTypes- a map of field id to the original type of the lower/upper bound, or null if unknown
-
-
Method Details
-
recordCount
Get the number of records (rows) in file.- Returns:
- the count of records (rows) in the file as a long
-
columnSizes
Get the number of bytes for all fields in a file.- Returns:
- a Map of fieldId to the size in bytes
-
valueCounts
Get the number of all values, including nulls, NaN and repeated.- Returns:
- a Map of fieldId to the number of all values including nulls, NaN and repeated
-
nullValueCounts
Get the number of null values for all fields in a file.- Returns:
- a Map of fieldId to the number of nulls
-
nanValueCounts
Get the number of NaN values for all float and double fields in a file.- Returns:
- a Map of fieldId to the number of NaN counts
-
lowerBounds
Get the non-null lower bound values for all fields in a file.To convert the
ByteBufferback to a value, useConversions.fromByteBuffer(org.apache.iceberg.types.Type, java.nio.ByteBuffer).- Returns:
- a Map of fieldId to the lower bound value as a ByteBuffer
- See Also:
-
upperBounds
Get the non-null upper bound values for all fields in a file.- Returns:
- a Map of fieldId to the upper bound value as a ByteBuffer
-
avgValueSizes
Get the average value size in memory (uncompressed) in bytes over non-null values, for all fields where it was collected.- Returns:
- a Map of fieldId to average value size in bytes
-