Spark: `changes` table returns swapped values when only some changelog columns are selected

Đang mở
#19,192 2 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 1 ngày

@adiranjan25 đang làm issue này rồi.

Từ ngày 30/11/2026.

  • #19207 của @adiranjan25 — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
61/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, spark
Lĩnh vực
backend, databases

Hướng nghiên cứu

Start by tracing how Spark plans projections for the Iceberg changes table, especially when only selected changelog columns or a metadata column are requested. Reproduce the three SQL queries in the issue on Spark 3.5.5 and compare their results with the expected values. Done means partial selections return each value in the correct column and the single-column query no longer throws a ClassCastException.

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

Mô tả

bug
Apache Iceberg version

1.12.0 (latest release)

Query engine

Spark

Please describe the bug 🐞

Selecting only some of _change_type, _change_ordinal and _commit_snapshot_id from a changes table, or one of them together with a metadata column, returns values in the wrong columns or fails with a ClassCastException. Reproduced on main (9d4f6c7, 2026-11-28) and 1.12.0, Spark 3.5.5.

Reproduction
CREATE TABLE local.db.t (id INT, data STRING) USING iceberg;
INSERT INTO local.db.t VALUES (1, 'a');

-- control: all three changelog columns
SELECT 'all', id, _change_type, _change_ordinal, _commit_snapshot_id FROM local.db.t.changes;
SELECT 'with _file', id, _change_type, substring_index(_file, '/', -1) FROM local.db.t.changes;
SELECT 'one column', id, _commit_snapshot_id FROM local.db.t.changes;
Expected
Query Result
all (control) 1 INSERT 0 <snapshot id>
with _file 1 INSERT 00000-0-...parquet
one column 1 <snapshot id>
Actual
Query Result
all (control) same
with _file 1 file:/.../00000-0-...parquet INSERT
one column ClassCastException: UTF8String cannot be cast to Long
Willingness to contribute
  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time
Ngôn ngữ chính
Java
Star
9.5k
Fork
3.7k
Merge trung bình
2 ngày 2 giờ
Pull request đã merge (30 ngày)
170

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

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

Tất cả issue của apache/iceberg

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.