Perf: update open_era5.py to use read_xarray_table with filter pushdown and lazy loading
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- google-cloud, python
- Bereich
- data-engineering, performance
Rechercherichtung
Start with perf_tests/open_era5.py and compare its existing read_xarray call with the proposed read_xarray_table flow. Add measurements for registration, a time filtered query, and a full scan, then run the benchmark with GCP authentication available and check that the output reports timings for each workload.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Context
perf_tests/open_era5.py currently uses the older read_xarray API, which returns an eager pa.RecordBatchReader. It also only prints the schema, making it impossible to benchmark real query performance.
Current state
# open_era5.py
era5_ds = xr.open_zarr("gs://gcp-public-data-arco-era5/...", chunks={"time": 240, "level": 1})
era5_wind_df = xql.read_xarray(
era5_ds[["u_component_of_wind", "v_component_of_wind"]]
)
print(era5_wind_df.schema)
Issues:
- Uses
read_xarrayinstead ofread_xarray_table— loses filter pushdown and lazy partition loading - Only inspects schema, never runs a query — no way to measure actual query performance
- Does not demonstrate the partition pruning benefit for time-range queries
Proposed update
# open_era5.py
import time
from datafusion import SessionContext
import xarray as xr
import xarray_sql as xql
era5_ds = xr.open_zarr(
"gs://gcp-public-data-arco-era5/ar/1959-2022-full_37-1h-0p25deg-chunk-1.zarr-v2",
chunks={"time": 240, "level": 1},
)
wind_ds = era5_ds[["u_component_of_wind", "v_component_of_wind"]]
# read_xarray_table: lazy, supports filter pushdown
table = xql.read_xarray_table(wind_ds, chunks={"time": 240})
ctx = SessionContext()
ctx.register_table("era5_wind", table)
# Filter pushdown: should prune most partitions
t0 = time.perf_counter()
result = ctx.sql(
"SELECT AVG(u_component_of_wind), AVG(v_component_of_wind) "
"FROM era5_wind WHERE time > '2020-01-01'"
).to_arrow_table()
print(f"Filter query: {time.perf_counter() - t0:.2f}s {result}")
Goals
- Serve as a real-world benchmark for ERA5 (the primary large-scale use case)
- Show filter pushdown pruning thousands of partitions
- Compare registration time, filter query time, and full-scan time
- Can be run with
py-spyto generate flame graphs once GCP auth is available
- Vorherrschende Sprache
- Python
- Sterne
- 142
- Forks
- 19
- Ø Merge
- 1 T. 6 Std.
- Gemergte PRs (30 T.)
- 10
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus xqlsystems/xarray-sql
-
documentation
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 85/100
xqlsystems/xarray-sql#268 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
xqlsystems/xarray-sql#267 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 74/100
xqlsystems/xarray-sql#243 ·
Maintainer antworten meist innerhalb von 1 Tag
-
publish.yml: the TestPyPI verification step is unreachable (and installs the wrong package name)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
xqlsystems/xarray-sql#242 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
xqlsystems/xarray-sql#237 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in xqlsystems/xarray-sql
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
GoogleCloudPlatform/gce-rescue#195 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag
-
intake mcp-intake needs-ac needs-human-review priority:medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
Ikalus1988/MisakaNet#3848 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
521xueweihan/HelloGitHub#4105 ·
-
bug size:XS
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag