You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "twmb (via GitHub)" <gi...@apache.org> on 2026/04/13 21:53:54 UTC
Re: [PR] feat(avro): replace hamba/avro with twmb/avro v1.5.0 [iceberg-go]
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org