Package org.apache.iceberg
Class MetricsUtil
java.lang.Object
org.apache.iceberg.MetricsUtil
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classA struct of readable metric values for a primitive columnstatic classFixed definition of a readable metric column, ie a mapping of a raw metric to a readable metricstatic classA struct, consisting of allMetricsUtil.ReadableColMetricsStructfor all primitive columns of the table
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final List<MetricsUtil.ReadableMetricColDefinition> static final String
- 
Method SummaryModifier and TypeMethodDescriptionstatic MetricscopyWithoutFieldCounts(Metrics metrics, Set<Integer> excludedFieldIds) Copies a metrics object without value, NULL and NaN counts for given fields.static MetricscopyWithoutFieldCountsAndBounds(Metrics metrics, Set<Integer> excludedFieldIds) Copies a metrics object without counts and bounds for given fields.createNanValueCounts(Stream<FieldMetrics<?>> fieldMetrics, MetricsConfig metricsConfig, Schema inputSchema) Construct mapping relationship between column id to NaN value counts from input metrics and metrics config.static MetricsModes.MetricsModemetricsMode(Schema inputSchema, MetricsConfig metricsConfig, int fieldId) Extract MetricsMode for the given field id from metrics config.static SchemareadableMetricsSchema(Schema dataTableSchema, Schema metadataTableSchema) Calculates a dynamic schema for readable_metrics to add to metadata tables.readableMetricsStruct(Schema schema, ContentFile<?> file, Types.StructType projectedSchema) Return a readable metrics struct row from file metadata
- 
Field Details- 
READABLE_METRIC_COLS
- 
READABLE_METRICS- See Also:
 
 
- 
- 
Method Details- 
copyWithoutFieldCountsCopies a metrics object without value, NULL and NaN counts for given fields.- Parameters:
- excludedFieldIds- field IDs for which the counts must be dropped
- Returns:
- a new metrics object without counts for given fields
 
- 
copyWithoutFieldCountsAndBoundspublic static Metrics copyWithoutFieldCountsAndBounds(Metrics metrics, Set<Integer> excludedFieldIds) Copies a metrics object without counts and bounds for given fields.- Parameters:
- excludedFieldIds- field IDs for which the counts and bounds must be dropped
- Returns:
- a new metrics object without lower and upper bounds for given fields
 
- 
createNanValueCountspublic static Map<Integer,Long> createNanValueCounts(Stream<FieldMetrics<?>> fieldMetrics, MetricsConfig metricsConfig, Schema inputSchema) Construct mapping relationship between column id to NaN value counts from input metrics and metrics config.
- 
metricsModepublic static MetricsModes.MetricsMode metricsMode(Schema inputSchema, MetricsConfig metricsConfig, int fieldId) Extract MetricsMode for the given field id from metrics config.
- 
readableMetricsSchemaCalculates a dynamic schema for readable_metrics to add to metadata tables. The type will be the structMetricsUtil.ReadableColMetricsStruct, composed ofMetricsUtil.ReadableMetricsStructfor all primitive columns in the data table- Parameters:
- dataTableSchema- schema of data table
- metadataTableSchema- schema of existing metadata table (to ensure id uniqueness)
- Returns:
- schema of readable_metrics struct
 
- 
readableMetricsStructpublic static MetricsUtil.ReadableMetricsStruct readableMetricsStruct(Schema schema, ContentFile<?> file, Types.StructType projectedSchema) Return a readable metrics struct row from file metadata- Parameters:
- schema- schema of original data table
- file- content file with metrics
- projectedSchema- user requested projection
- Returns:
- MetricsUtil.ReadableMetricsStruct
 
 
-