apache / apache/iceberg-python
`DataScan` `count` method does not respect limit
- Lenguaje dominante
- Python
- Estrellas
- 1.1k
- Forks
- 581
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 77
Descripción
### 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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza en pyiceberg/table/__init__.py alrededor de la línea 1940 y sigue DataScan.count a través de la llamada subyacente a ArrowScan. Comprueba cómo se propaga el límite e identifica el comportamiento adicional del escaneo que, según las notas del issue, podría necesitar ajustes. Se considera terminado cuando count() devuelve como máximo el límite solicitado y evita trabajo de escaneo innecesario.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- data-engineering, databases
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 68/100