rdblue commented on code in PR #18405: URL: https://github.com/apache/iceberg/pull/18405#discussion_r4212506362
########## format/spec.md: ########## @@ -436,6 +436,26 @@ Two rows are the "same"---that is, the rows represent the same entity---if the i Identifier fields may be nested in structs but cannot be nested within maps or lists. Float, double, and optional fields cannot be used as identifier fields and a nested field cannot be used as an identifier field if it is nested in an optional struct, to avoid null values in identifiers. +#### Stats-only Fields + +Stats are tracked in manifests by field ID. Schema fields have assigned IDs, but additional field IDs may be assigned to track stats for derived values. For instance, lower and upper bounds for `to_lower_case(name)` are useful for case-insensitive file pruning. + +Stats-only fields are used to track stats for derived values that are not part of the table schema and are not materialized. A stats-only field consists of: + +* A **`field-id`** assigned by incrementing the table's `last-field-id` +* A **`type`** that can be `partition-value` or `expr-value` +* Type-specific fields that defines how derived values are produced + +The `partition-value` type stores stats for the output of a partition field, identified by a `partition-field-id` type-specific field. The lower and upper bound type is the partition field's result type. Review Comment: I'm updating this to add "This may be used in v4 to filter by bucket partition values". I'm reluctant to over-specify what it can be used for because this should be mostly independent of the partition transforms that we add over time, and we don't typically put recommendations in the spec (like "don't use this for monotonic functions"). Hopefully this clarification / example works. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
