apache / apache/arrow

slow performance when reading data from GCP

Open
#32,919 0 comments 0 reactions 0 assignees View on GitHub
Component: Parquet Component: Python Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 18h
Merged PRs (30d)
91

Description

I am using pyarrow and duckdb to query some parquet files in GCP, thanks for making  the experience so smooth, but I have an issue with the performance, see code used.
import pyarrow.dataset as ds
import duckdb
import json
lineitem = ds.dataset("gs://xxxxx/lineitem")
lineitem_partition = ds.dataset("gs://xxxx/yyy",format="parquet", partitioning="hive")
lineitem_180 = ds.dataset("gs://xxxxx/lineitem_180",format="parquet", partitioning="hive")
con = duckdb.connect()
con.register("lineitem", lineitem)
con.register("lineitem_partition", lineitem_partition)
con.register("lineitem_180", lineitem_180)
def Query(request):
    SQL = request.get_json().get('name')
    df = con.execute(SQL).df()
    return json.dumps(df.to_json(orient="records")), 200, \{'Content-Type': 'application/json'}
 
the issue is I am getting slow some extremely slow throughput performance, around 30 MBper second, the same files using local ssd laptop is extremely fast.
I am not sure what's the issue, I tried using pyarrow compute Query and it is the same performance 

**Reporter**: [mimoune djouallah](https://issues.apache.org/jira/browse/ARROW-17679)

**Note**: *This issue was originally created as [ARROW-17679](https://issues.apache.org/jira/browse/ARROW-17679). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported benchmark using the provided pyarrow.dataset and DuckDB code against the gs:// Parquet paths, comparing it with the local SSD result. Measure the roughly 30 MB/s throughput and isolate whether the slowdown is in GCP access or the query path; done means a reproducible diagnosis and a clearly identified next change.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, python
Domain
cloud, data-engineering, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.