twmb commented on code in PR #871:
URL: https://github.com/apache/iceberg-go/pull/871#discussion_r3076023676
##########
manifest.go:
##########
@@ -1817,62 +1785,57 @@ func (d *dataFile) initializeMapData() {
func (d *dataFile) convertAvroValueToIcebergType(v any, fieldID int) any {
if logicalType, ok := d.fieldIDToLogicalType[fieldID]; ok {
switch logicalType {
- case avro.Date:
+ case atype.Date:
+ // twmb/avro returns time.Time when the file schema has
logicalType,
+ // but raw int32 when the file schema omits it.
if val, ok := v.(time.Time); ok {
return Date(val.Truncate(24*time.Hour).Unix() /
int64((time.Hour * 24).Seconds()))
}
return Date(v.(int32))
- case avro.TimeMillis:
+ case atype.TimeMillis:
if val, ok := v.(time.Duration); ok {
Review Comment:
Comment added at the top of the switch rather than per case
--
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]