Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Breaking change in Avro 1.12.1 affects parquet-avro users: logical types now deserialize to different Java types

Đang mở
#3,515 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
java
Lĩnh vực
data-engineering

Hướng nghiên cứu

Bắt đầu với liên kết AVRO-3989 của issue và hành vi của ReflectData, SpecificData và GenericRecord được mô tả ở đây; không có tệp hoặc test nào của parquet-java được nêu tên. So sánh cách xử lý các kiểu logic được liệt kê trong Avro 1.12.0 và 1.12.1, sau đó xác định với các maintainers thay đổi hoặc tài liệu nào được mong đợi trước khi định nghĩa thế nào là hoàn tất.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

Avro 1.12.1 introduces a breaking change that affects parquet-avro users. Multiple logical types are now deserialized to their proper Java types instead of their underlying primitive types when using ReflectData, causing ClassCastException in existing code.

Background

Problem

The fix in AVRO-3989 changed the deserialization behavior for ALL logical types. When using within parquet-avro ReflectData or SpecificData classes, these fields now return their logical Java type objects instead of their underlying primitive types from GenericRecord.

Affected logical types and conversions:
Logical Type Old Type (≤1.12.0) New Type (1.12.1)
timestamp-millis Long Instant
timestamp-micros Long Instant
date Integer LocalDate
time-millis Integer LocalTime
time-micros Long LocalTime
local-timestamp-millis Long LocalDateTime
local-timestamp-micros Long LocalDateTime
uuid String UUID
decimal ByteBuffer BigDecimal

This breaks existing code that expects primitive values:

// This used to work in Avro 1.12.0
Long timestamp = (Long) genericRecord.get("timestamp_field");
Integer date = (Integer) genericRecord.get("date_field");
String uuid = (String) genericRecord.get("uuid_field");

// In Avro 1.12.1, all of these throw ClassCastException
// because values are now Instant, LocalDate, UUID, etc.

Impact

  • Widespread breakage: Affects anyone using parquet-avro with ANY logical types
  • Code that has worked for years suddenly breaks after a patch version update
  • The breaking nature wasn't clearly documented in Avro's changelog
  • This is a significant behavior change that affects the entire logical type system

Heads up for future avro updates

I apologize if this isn't the right place to report this, please feel free to redirect me if there's a better venue for this discussion. My main goal is to ensure that when parquet-java does consider updating Avro, the team and users are aware of this significant behavioral change.

For Current Users

If you're using parquet-avro and explicitly upgrading Avro to 1.12.1+ in your project, be aware of this breaking change. You'll need to update code that reads logical type fields from GenericRecord.

Ngôn ngữ chính
Java
Star
3.1k
Fork
1.6k
Merge trung bình
4 ngày 5 giờ
Pull request đã merge (30 ngày)
30

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/parquet-java

Tất cả issue của apache/parquet-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.