apache / apache/iceberg-python
`DataScan` `count` method does not respect limit
- Langage dominant
- Python
- Étoiles
- 1.1k
- Forks
- 581
- Merge moyen
- 1 j 17 h
- PR mergées (30 j)
- 77
Description
### 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
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez dans pyiceberg/table/__init__.py vers la ligne 1940 et suivez DataScan.count à travers l’appel ArrowScan sous-jacent. Vérifiez comment la limite est propagée et identifiez le comportement supplémentaire du scan qui pourrait devoir être ajusté, comme l’indiquent les notes de l’issue. C’est terminé lorsque count() ne renvoie pas plus que la limite demandée tout en évitant un travail de scan inutile.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- data-engineering, databases
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 68/100