Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Perf: limit pushdown — avoid materializing full partitions for LIMIT queries

Aperta
#131 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
data, performance

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

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

Lingua principale
Python
Stelle
142
Fork
19
Merge medio
1g 9h
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di xqlsystems/xarray-sql

Tutte le issue di xqlsystems/xarray-sql

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.