apache / apache/iceberg-python
Avro schema is re-converted to an Iceberg schema on every manifest read during scan planning
- Linguagem predominante
- Python
- Estrelas
- 1.1k
- Forks
- 588
- Merge médio
- 1d 23h
- PRs com merge (30d)
- 84
Descrição
### 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.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Comece em pyiceberg/avro/file.py, em AvroFileHeader.get_schema(), e acompanhe a conversão avro_to_iceberg. Use scan().plan_files() com manifestos repetidos para observar o trabalho repetido e confirmar que os resultados da conversão são reutilizados pela string do schema, com o desempenho do planejamento melhorando à medida que a quantidade de manifestos aumenta.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- performance
- Tipo de issue
- Refatoração
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Pouca atividade
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 78/100