You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
read_xarray registration is O(num_chunks): one partition per native chunk, intractable on finely-chunked stores #174
read_xarray_table creates one scan partition per native chunk and enumerates them all at registration, so registration cost is O(num_chunks) rather than O(data_size). On finely-chunked stores this makes registration intractable.
Measured (tiny synthetic data, same data, only the chunking changes)
Public Arraylake GOES (earthmover-public/goes-16, group ABI-L2-MCMIPF/post-2023-04-19) is chunked one timestep per chunk:
CMI_C13 chunks -> t: 102,988 chunks of size 1 ; y, x: 24 chunks of 226
That is 102988 * 24 * 24 = ~59M partitions for a single variable, i.e. ~25-30 minutes just to register one variable. Registering all 188 variables never finishes. Coarsening the time chunks and pre-loading coordinates did not help (still minutes).
Proposal
Decouple partition count from native chunk count: coalesce native chunks into a bounded number of scan partitions (e.g. a target partition count / size), or enumerate partitions lazily, so registration cost is independent of how finely the store is chunked.
Context
Surfaced via Lumen's XArraySQLSource (holoviz/lumen#1889), which compounds it by registering per-variable.
Activity
fix: coalesce native chunks into bounded scan partitions (xqlsystems#174
alxmrs commentedon Jun 22, 2026
This test may be slow because of the use of dask, not because of what we implement in xarray-sql.
This line enables dask and builds a dask task graph, which takes a lot of time:
If you removed the
.chunk()operation and then ran the test and registration was still slow, then it would warrant solving imo.JHON12091986 commentedon Jul 2, 2026
/claim #174
I'll investigate the arrow view similar to NumPy array to avoid sparse copy.
Will include:
PR ready in 12-24 hours.