Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daskms.experimental.xds_to_zarr may fail due to large chunks #283

Open
JSKenyon opened this issue Aug 14, 2023 · 0 comments
Open

daskms.experimental.xds_to_zarr may fail due to large chunks #283

JSKenyon opened this issue Aug 14, 2023 · 0 comments

Comments

@JSKenyon
Copy link
Collaborator

  • dask-ms version: master
  • Python version: 3.10.12
  • Operating System: Ubuntu 20.04 LTS

Description

When attempting to write an xarray.Dataset with large chunks to zarr, I got the following error:

ValueError: Column FLAG has a chunk of dimension (132750, 4096, 4) that will exceed zarr's 2GiB chunk limit

What I Did

xds_to_zarr([xds_with_large_chunks], "test.zarr", rechunk=True)

Possible solution

This problem can be solved in a number of ways:

  1. In user code: I could manually figure out and rechunk before writing.
  2. As part of maybe_rechunk in xds_to_zarr: This functionality currently forces chunks to match those already on disk. It would not be a stretch to extend this to include the case where a new zarr output is being written.
  3. As a utility function: A function could be added e.g. rechunk_for_disk, which a user could call prior to writing an xarray.Dataset to disk.

Practically, a combination of 2 and 3 will likely be best i.e. write a utility function and then call it as part of xds_to_zarr. I will take a stab at this this week.

@JSKenyon JSKenyon changed the title daskms.experimental.xds_to_zarr daskms.experimental.xds_to_zarr may fail due to large chunks Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant