Repository navigation
Closed
Labels
dataframeioneeds attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.parquet
Description
Recently I ran into some issues processing large Parquet datasets which were stored in S3 (with the code snippet below) and raised a few corresponding issues:
- S3 rate limit encountered during DataFrame computation #8026
- Parquet
_metadatatoo large to parse #8027 - Disabling loading consolidated Parquet
_metadata#8030 - Parquet filepath parsing error #8028
- Overwriting parquet dataset on S3 doesn't create a new bucket #8056
I'm wondering if others folks have run into other issues themselves. I'd like to use this issue to solicit and track issues related to processing large, remote Parquet datasets.
import pandas as pd
import dask
import dask.dataframe as dd
from dask.distributed import Client
# Use Coiled to create a large cluster.
# Though any Dask cluster would work just as well.
import coiled
cluster = coiled.Cluster(n_workers=200, worker_memory="16 GiB")
client = Client(cluster)
# Generate a large synthetic dataset and write it to S3
df = dask.datasets.timeseries(
dtypes={str(i): int for i in range(1_000)},
freq="1s",
start="2000-01-01",
end="2021-01-01",
)
storage_options={"config_kwargs": {"region_name": "us-east-1"}}
df.to_parquet(
"s3://<bucket>/timeseries.parquet",
engine="pyarrow-dataset",
overwrite=True,
storage_options=storage_options,
)
# Read in dataset and do some basic processing
df = dd.read_parquet(
"s3://<bucket>/timeseries.parquet",
engine="pyarrow-dataset",
storage_options=storage_options,
)
def func(row: pd.Series) -> str:
return f"{row[0]}-{row[1]}-{row[2]}"
df["new"] = df.apply(func, axis=1)
# Write processed dataset back to S3
df.to_parquet(
"s3://<bucket>/timeseries-processed.parquet",
engine="pyarrow-dataset",
overwrite=True,
storage_options=storage_options,
)Metadata
Metadata
Assignees
Labels
dataframeioneeds attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.parquet
Activity
avriiil commentedon Aug 17, 2021
Not entirely sure this is related @jrbourbeau as your issues seem to do more with reading rather than writing parquet files. But thought I'd share anyway, feel free to LMK if it'd be more useful for me to post this elsewhere.
I'm running into issues when writing larger datasets to parquet into a public S3 bucket with the code snippet below.
tl;dr
Small, dummy datasets work (see "This Works" section below) but larger timeseries dataframe (thousands of partitions) fails (see "This Fails" section) with a KilledWorker error. Writing
to_csvworks for both the small and the large datasets.IMPORTS AND SPINNING UP CLUSTER
THIS WORKS
THIS FAILS
I get a warning when I run the cell:
And the cell ends up throwing an error after killing and restarting workers a few times:
I'm running:
Tagging @fjetter as he's done some debugging work on this, too.
avriiil commentedon Aug 17, 2021
FWIW this workaround suggested to me by @fjetter does work:
fjetter commentedon Aug 17, 2021
@rrpelgrim As already discussed, the KilledWorker problem of yours is related to a segmentation fault with
pyarrowand is not connected to this issue. The workaround works because you're not usingpyarrow. Can you please open a new issue for this?avriiil commentedon Aug 18, 2021
@fjetter -- apologies for the confusion, will open a new issue. Would it be best for me to remove my comments above from this thread?
jcrist commentedon May 27, 2022
All the linked issues have been resolved, closing this in favor of more specific issues.
mrocklin commentedon May 27, 2022