apache / apache/iceberg-python

Avro schema is re-converted to an Iceberg schema on every manifest read during scan planning

Abierto Apto para principiantes
#3,662 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
1.1k
Forks
581
Merge medio
1 d 17 h
PR fusionados (30 d)
77

Descripción

### 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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comience en pyiceberg/avro/file.py, en AvroFileHeader.get_schema(), y siga la conversión avro_to_iceberg. Use scan().plan_files() con manifiestos repetidos para observar el trabajo repetido y confirmar que los resultados de la conversión se reutilizan según la cadena del esquema, con una mejora del rendimiento de planificación a medida que aumenta el número de manifiestos.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
performance
Tipo de issue
Refactorización
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Tranquilo
Claridad
Bien especificado
Aptitud para principiantes
78/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.