Fokko commented on code in PR #11749: URL: https://github.com/apache/iceberg/pull/11749#discussion_r1881537732
########## format/spec.md: ########## @@ -454,7 +454,7 @@ Partition field IDs must be reused if an existing partition spec contains an equ | **`truncate[W]`** | Value truncated to width `W` (see below) | `int`, `long`, `decimal`, `string`, `binary` | Source type | | **`year`** | Extract a date or timestamp year, as years from 1970 | `date`, `timestamp`, `timestamptz`, `timestamp_ns`, `timestamptz_ns` | `int` | | **`month`** | Extract a date or timestamp month, as months from 1970-01-01 | `date`, `timestamp`, `timestamptz`, `timestamp_ns`, `timestamptz_ns` | `int` | -| **`day`** | Extract a date or timestamp day, as days from 1970-01-01 | `date`, `timestamp`, `timestamptz`, `timestamp_ns`, `timestamptz_ns` | `int` | +| **`day`** | Extract a date or timestamp day, as days from 1970-01-01 | `date`, `timestamp`, `timestamptz`, `timestamp_ns`, `timestamptz_ns` | `int` (the physical type should be an `int`, but the the logical type should be a `date`) | Review Comment: I needed some time to think about this. I would also lean towards stating that it returns a `date`. The confusion (and also the terminology) comes from that it is being encoded in Avro where the physical (bytes written to disk) is an `int`, that's annotated with a logical type that it represents a `date`. The relevant piece of code: https://github.com/apache/iceberg/blob/fe2f593cd025223e4ab5ab41a296fb106ce3b1cf/api/src/main/java/org/apache/iceberg/transforms/Dates.java#L92-L98 Curious to learn what others think @RussellSpitzer @rdblue @danielcweeks @nastra -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org