apache / apache/iceberg-python

`DataScan` `count` method does not respect limit

Aberta
#2,121 10 comentários 1 reação 0 responsáveis Ver no GitHub
stale
Linguagem predominante
Python
Estrelas
1.1k
Forks
581
Merge médio
1d 17h
PRs com merge (30d)
78

Descrição

### Apache Iceberg version

0.9.1 (latest release)

### Please describe the bug 🐞

When calling `count()` on a `DataScan`, limit is not respected. Seems trivial but if I set a limit of 5 I expect 5 or less rows back, at least with a scan-like implementation

The underlying `ArrowScan` does not get passed the limit param

https://github.com/apache/iceberg-python/blob/main/pyiceberg/table/__init__.py#L1940

This results in scans taking longer due to not respecting the limit.

The fix will involve more than just passing the limit to the `ArrowScan`

### Willingness to contribute

- [x] I can contribute a fix for this bug independently
- [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Comece em pyiceberg/table/__init__.py, por volta da linha 1940, e acompanhe DataScan.count por meio da chamada subjacente a ArrowScan. Verifique como o limite é propagado e identifique o comportamento adicional de varredura que as notas do issue indicam que pode precisar de ajuste. Considera-se concluído quando count() retorna no máximo o limite solicitado, evitando trabalho de varredura desnecessário.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
data-engineering, databases
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Ativa
Clareza
Razoavelmente clara
Facilidade para iniciantes
68/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.