Fokko commented on code in PR #11749:
URL: https://github.com/apache/iceberg/pull/11749#discussion_r1883817906


##########
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:
   > The value should be serialized/displayed as Date (This is not mentioned in 
the spec here, but is in the reference implementation.)
   
   Yes, but since it is serialized with Avro, it will always be an `int`:
   
   ```json
   {
     "type": "int",
     "logicalType": "date"
   }
   ```
   
   Specifying this twice would lead to duplication of [the Avro 
spec](https://avro.apache.org/docs/1.12.0/specification/#date) into the Iceberg 
spec. The error in Iceberg-Rust did raise my eyebrow a bit since I would expect 
it to read the `int` without the `logicalType` as well because there is no 
ambiguity.



-- 
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

Reply via email to