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
[Parquet][Python] Potential regression in Parquet parallel reading #38591
UPDATE: this is looking more like a bug on closer look. What happens:
When calling to_table() on a FileSystemDataset in Python using pyarrow.fs.S3FileSystem,
Using 02de3c1, one HEAD request and two GET requests are made for each file. Also the requests are made concurrently.
With current main, there are two HEAD requests and three GET requests for each file. Also, the first HEAD request is made from the main thread so the downloads are started sequentially. I would expect to see only one HEAD request, not sure if the three GET are expected due to some change.
Here's an example using 02de3c1, reading a FileSystemDataset using fragment_readahead = 100 and io concurrency set to 100; Y-axis represents files and X-axis is time in seconds, and each point is the relative start time of a request (HEAD or GET):
With the current mainfc8c6b7 it seems that the first request for each file is made from the same thread (blue), and notably there are five requests per each file.
As a side note, I was a bit disappointed with the total download times I achieved with maximum parallelism using 02de3c1 on my system (Macbook to S3). The requests start with nice concurrency but a few of the GET requests end up taking quite long to finish, so fragment_readahead > 4 doesn't speed up the total completion time at all. Not sure if this is related to my network, or if it's something to optimize in Arrow.
changed the title [-]Potential regression in Parquet parallel reading[/-][+][Parquet] Potential regression in Parquet parallel reading[/+]on Nov 6, 2023
changed the title [-][Parquet] Potential regression in Parquet parallel reading[/-][+][Parquet][Python] Potential regression in Parquet parallel reading[/+]on Nov 6, 2023
Very nice catch! Seems that this commit ignore your change and re-create the file. this might be done before your change is checked in 😅 And after your change and rebase, this didn't get modified.
Very nice catch! Seems that this commit ignore your change and re-create the file. this might be done before your change is checked in 😅 And after your change and rebase, this didn't get modified.
Yeah that was my reading as well, I can try fixing it later
I think we can Provide a MockInputStream(with readAsync and read counting) and hardcode an IO-count here. Any change changes the IO count can report the change here.
Activity
eeroel commentedon Nov 5, 2023
As a side note, I was a bit disappointed with the total download times I achieved with maximum parallelism using 02de3c1 on my system (Macbook to S3). The requests start with nice concurrency but a few of the GET requests end up taking quite long to finish, so fragment_readahead > 4 doesn't speed up the total completion time at all. Not sure if this is related to my network, or if it's something to optimize in Arrow.
eeroel commentedon Nov 5, 2023
I noticed that there is an extra HEAD request coming from somewhere so I think what I wrote below is unlikely to be related
[-]Potential regression in Parquet parallel reading[/-][+][Parquet] Potential regression in Parquet parallel reading[/+][-][Parquet] Potential regression in Parquet parallel reading[/-][+][Parquet][Python] Potential regression in Parquet parallel reading[/+]eeroel commentedon Nov 7, 2023
Here's a reproducible example that doesn't use FileSystemDataset but
parquet.read_table:This does not only make two HEAD requests, but four of them in total (first two in getting the schema?)
mapleFU commentedon Nov 7, 2023
Since this is merged recently, is that same api being used ? I was a bit confused because this part of code didn't changed frequency recently...
eeroel commentedon Nov 7, 2023
I'm doing a bisect at the moment, I'll update here when I'm done.
mapleFU commentedon Nov 7, 2023
#36765
The issue related patch changes Prefetch default mode from
DefaulttoLazyDefault, but it maybe doesn't increment the req-count..eeroel commentedon Nov 7, 2023
This is the commit after which there is an extra HEAD request:
0793432
eeroel commentedon Nov 7, 2023
This is probably where the extra requests come from, I wonder if these
source.Open()andparquet::ParquetFileReader::OpenAsynccalls are necessary?arrow/cpp/src/arrow/dataset/file_parquet.cc
Line 507 in 0793432
mapleFU commentedon Nov 7, 2023
Very nice catch! Seems that this commit ignore your change and re-create the file. this might be done before your change is checked in 😅 And after your change and rebase, this didn't get modified.
eeroel commentedon Nov 7, 2023
Yeah that was my reading as well, I can try fixing it later
mapleFU commentedon Nov 7, 2023
Yeah. Maybe we can add a test for counting IO-ops to prevent from regression later... This is so awkward :-(
1 remaining item
mapleFU commentedon Nov 7, 2023
I think we can Provide a MockInputStream(with readAsync and read counting) and hardcode an IO-count here. Any change changes the IO count can report the change here.
Also cc @pitrou for any more ideas...
But you can take a quick fixing for this issue.
GH-38591: [Parquet][C++] Remove redundant open calls in `ParquetFileF…
mapleFU commentedon Nov 8, 2023
Thanks @eeroel
I've merged this patch now, maybe I'll try to add some counting test tonight
eeroel commentedon Nov 8, 2023
Thank you!
apacheGH-38591: [Parquet][C++] Remove redundant open calls in `Parque…
GH-38591: [Parquet][C++] Remove redundant open calls in `ParquetFileF…
apacheGH-38591: [Parquet][C++] Remove redundant open calls in `Parque…