Make manifest records schema-aware to avoid field mismatches across format versions
Maintainer antworten meist innerhalb von 1 Tag
@kevinjqliu arbeitet bereits daran.
Seit 12.9.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Apache Iceberg version
main (development), commit 308768d99
Please describe the bug 🐞
Manifest records do not retain their schema, and their property getters use hard-coded field positions. When the in-memory record layout differs from the file schema, this can cause incorrect field access or silent data loss during serialization.
For example, referenced_data_file has field ID 143 in both v2 and v3, but its zero-based position differs:
| Field | v2 position | v3 position |
|---|---|---|
first_row_id |
Not present | 16 |
referenced_data_file |
16 | 17 |
This causes two problems:
- Writing a v3 record to a v2 file:
DataFile.from_args()defaults to the v3 layout. When writing it throughAvroOutputFilewith a v2 file schema, omittingrecord_schemamakes the writer read position 16 instead of 17 forreferenced_data_file. Iffirst_row_idis null, a non-null reference is silently written as null. Explicitly supplying the v3 record schema enables the existing field-ID projection and preserves the value. - Accessing a v2 record:
DataFile.from_args(_table_format_version=2, ...)stores the reference at position 16, but the getters still assume v3 positions. Consequently,first_row_idreturns the reference path andreferenced_data_fileraisesIndexError. Reading a v2 file intoDataFilewithout projecting to v3 has the same mismatch.
The normal manifest read/write helpers already supply the v3 projection. However, correctness still depends on callers separately tracking the in-memory layout and supplying the matching schema.
Proposed behavior
Records should keep the schema that describes their in-memory layout. Getters should use field IDs, not assume a particular version’s field positions.
When reading, use the schema from the file. If the read projects into another schema, retain that schema on the resulting record.
When writing, callers should only need to specify the target format version, or file_schema when using AvroOutputFile. IO should determine the input layout from the record and handle the conversion before encoding. This needs to account for nested records and partition fields, not just the top-level record.
We shouldn’t need to pass record_schema just to prevent a field from being read at the wrong position. Keep it supported for callers that explicitly provide it.
For the example above, writing a default v3 record to a v2 file should preserve referenced_data_file without passing record_schema. If a conversion isn’t supported, raise an error rather than silently writing the wrong value.
Willingness to contribute
N/A
- Vorherrschende Sprache
- Python
- Sterne
- 1.1k
- Forks
- 606
- Ø Merge
- 1 T. 11 Std.
- Gemergte PRs (30 T.)
- 76
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/iceberg-python
-
View does not expose metadata_location: RestCatalog.load_view discards it from the server's responseEvtl. vergeben @Soumo-git-hub hat das vor 1 Tag übernommen. Offenkind:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
apache/iceberg-python#4073 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
apache/iceberg-python#4010 · 3 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
to_bytes silently rescales a Decimal with a negative scaleEvtl. vergeben @Rodrigo-Palma hat das vor 17 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/iceberg-python#3996 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Deletion vector bitmap count is read from the blob and used as a loop bound without validationEvtl. vergeben @ghoshp83 hat das vor 18 Tagen übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
apache/iceberg-python#3979 ·
Maintainer antworten meist innerhalb von 1 Tag
-
FsspecFileIO: `_adls` mutates shared properties, so a second storage account gets the first account's filesystemEvtl. vergeben @krishnakaanchan-png hat das vor 35 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/iceberg-python#3885 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in apache/iceberg-python
Ähnliche Issues
-
bug llm translation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Arkansas 2025 tax is $1.70 high above $100,000 net taxable income ($3,809 + 3.9% rule)Evtl. vergeben @PavelMakarchuk hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
PolicyEngine/policyengine-us#9828 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
jellyfin/jellyfin-mpv-shim#800 ·
Maintainer antworten meist innerhalb von 1 Tag
-
skillfs: one malformed chat-log line aborts the entire skill-usage analysis (skill_usage_from_chat_logs.py)Evtl. vergeben @zjncs hat das heute übernommen. Offencomponent:skillfs
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
agentic-os-org/ANOLISA#6116 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
P4: low query
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
jeffknupp/association#336 ·