Spark: `changes` table returns swapped values when only some changelog columns are selected
维护者通常 1 天内回复
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Java
- 星标
- 9.5k
- 派生
- 3.7k
- 平均合并
- 2 天 2 小时
- 30 天内合并 PR
- 170
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/iceberg 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Spark: Test INSERT targets with computed IDENTIFIER expressions可能已有人在做 @shivadarshan-devadiga 于 15 天前认领。 未关闭improvement
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
[Core] TestAvroPartitionStatsHandler fails on Windows due to unclosed partition statistics scan可能已有人在做 @Ankitkj1999 于 17 天前认领。 未关闭
难度 1/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
Core: TableMetadata.Builder allows adding encryption keys to v1/v2 tables可能已有人在做 @yusufyildiz34 于 37 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
apache/iceberg#18632 · 1 条评论 ·
维护者通常 1 天内回复
-
Kafka: Filter empty strings and whitespace in IcebergSinkConfig stringToList可能已有人在做 @mohamed-elbrik 于 42 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
相似的 Issue
-
bug vault
难度 2/5 1-3 小时 新手友好度 88/100
bancolombia/secrets-manager#150 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 92/100
HexaHexes/neoforge-mod-template#124 ·
维护者通常 1 天内回复
-
awaiting triage java new feature P2
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
source-survicate: pagination reads pagination and stops after one page; substreams drop survey_id未关闭
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
OpenLiberty/open-liberty#36410 ·
维护者通常 1 天内回复