apache / apache/iceberg-python
Avro schema is re-converted to an Iceberg schema on every manifest read during scan planning
- Langage dominant
- Python
- Étoiles
- 1.1k
- Forks
- 581
- Merge moyen
- 1 j 17 h
- PR mergées (30 j)
- 78
Description
### 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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez dans pyiceberg/avro/file.py, au niveau de AvroFileHeader.get_schema(), et suivez la conversion avro_to_iceberg. Utilisez scan().plan_files() avec des manifestes répétés pour observer le travail répété et confirmer que les résultats de conversion sont réutilisés en fonction de la chaîne du schéma, avec une amélioration des performances de planification à mesure que le nombre de manifestes augmente.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- performance
- Type d'issue
- Refactorisation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- Calme
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 78/100