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

DNM: Dumb Read Parquet Implementation #373

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mrocklin
Copy link
Member

This is a dumb, mostly-from-scratch implementation of read_parquet.

It only supports

  • local and s3
  • column selection
  • grouping partitions when we have fewer columns (+ threads!)
  • arrow engine/filesystem

It is very broken in many ways, but ...

  • It's only around 100 lines of code
  • I get 250 MB/s bandwidth on full column reads on an m6i.xlarge (only 50 MB/s when reading columns though)

See dask/dask#10602

This is a dumb, mostly-from-scratch implementation of read_parquet.

It only supports
-  local and s3
-  column selection
-  grouping partitions when we have fewer columns (+ threads!)
-  arrow engine/filesystem

It is very broken in many ways, but ...

-  It's only around 100 lines of code
-  I get 250 MB/s bandwidth on full column reads on an m6i.xlarge
   (only 50 MB/s when reading columns though)

See dask/dask#10602
Comment on lines +475 to +479
return pa.concat_tables(list(map(read_arrow_table, batch)))
else:
with concurrent.futures.ThreadPoolExecutor(len(batch)) as e:
parts = list(e.map(read_arrow_table, batch))
return pa.concat_tables(parts)
Copy link
Member

@fjetter fjetter Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI concat_tables will concat tables zero copy which is great at first glance (It will essentially just append the batch to a ChunkedArray). However, if the tables are heavily fragmented, i.e. there are many batches, many operations operate very slowly on this (e.g. serialization).
calling combine_chunks on the table merges the batches (but copies data) which is sometimes beneficial. I haven't tested this for the arrow->pandas conversion.
This came up in P2P, primarily in the context of writing the table to disk

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

Successfully merging this pull request may close these issues.

2 participants