apache / apache/iceberg-python
Avro schema is re-converted to an Iceberg schema on every manifest read during scan planning
- Lingua principale
- Python
- Stelle
- 1.1k
- Fork
- 581
- Merge medio
- 1g 17h
- PR unite (30g)
- 78
Descrizione
### Feature Request / Improvement
`AvroFileHeader.get_schema()` (`pyiceberg/avro/file.py`) runs the full `avro_to_iceberg` conversion every time an
Avro file is opened.
**The inefficiency**
- Every manifest under a spec embeds an *identical* Avro schema string.
- So during scan planning, that same conversion is repeated **once per manifest**.
- The cost grows with the manifest count, even though only a couple of distinct schemas are ever involved.
**Proposed fix**
- The conversion depends only on the schema string, so the result can be cached (keyed on that string).
**Measured impact**
- `scan().plan_files()` on an unpartitioned 150-manifest table: **~86 ms → ~48 ms (~1.8× faster)**.
- The saving grows as the number of manifests increases.
I am willing to contribute for this improvement.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Iniziate in pyiceberg/avro/file.py, in AvroFileHeader.get_schema(), e seguite la conversion avro_to_iceberg. Usate scan().plan_files() con manifest ripetuti per osservare il lavoro ripetuto e confermare che i risultati della conversione vengano riutilizzati in base alla stringa dello schema, con prestazioni di pianificazione migliori all'aumentare del numero di manifest.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- performance
- Tipo di issue
- Refactoring
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 78/100