Perf: limit pushdown — avoid materializing full partitions for LIMIT queries
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- python
- Domaine
- data, performance
Piste de recherche
Start by reading PrunableStreamingTable::scan() and the path that carries the limit through PyArrowStreamPartition into the partition factory; the issue names no file or test. Check how projection is passed as a model, then determine how the factory can stop producing rows at the requested limit. Done means a query such as SELECT * FROM ds LIMIT 10 avoids materializing the full first matching partition.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Problem
The partition factory always materializes the full partition regardless of query:
df = pivot(ds.isel(block)) # always loads all 38.4M rows
For queries like SELECT * FROM ds LIMIT 100, DataFusion applies the limit after the factory produces its batch. The factory receives no signal to stop early.
Currently limit is passed from PrunableStreamingTable::scan() down to DataFusion's StreamingTable, which applies it at the execution-plan level — but only after the factory has already materialized the full partition.
Proposed fix
Pass an optional row limit into the factory (similar to projection pushdown). The scan() method can thread the limit through PyArrowStreamPartition so the factory can stop generating rows once the limit is reached.
def make_stream(projection, limit=None) -> pa.RecordBatchReader:
rows_needed = limit or total_rows
# only materialize up to rows_needed rows
Impact
For ARCO-ERA5, LIMIT 10 currently reads 38.4M rows from the first matching partition. With this fix it would read at most batch_size rows.
Parent: #126
- Langage dominant
- Python
- Étoiles
- 142
- Forks
- 19
- Merge moyen
- 1 j 9 h
- PR mergées (30 j)
- 9
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de xqlsystems/xarray-sql
-
documentation
Difficulté 1/5 1-3 heures Accessibilité débutants 85/100
xqlsystems/xarray-sql#268 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
xqlsystems/xarray-sql#267 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 74/100
xqlsystems/xarray-sql#243 ·
Les mainteneurs répondent en général sous 1 jour
-
publish.yml: the TestPyPI verification step is unreachable (and installs the wrong package name)Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
xqlsystems/xarray-sql#242 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
xqlsystems/xarray-sql#237 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de xqlsystems/xarray-sql
Issues similaires
-
Issue Triage-Needed
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
pulp/pulp_container#2581 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
521xueweihan/HelloGitHub#4040 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
ClanGenOfficial/clangen#6313 ·
Les mainteneurs répondent en général sous 2 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour
-
bug(trainer): CustomTrainer func_args with non literal values fail inside the TrainJobPeut-être pris @avanishkasar l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
kubeflow/sdk#879 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour