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
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
When using datafusion-python as a compute backend from multi-threaded Python applications (e.g., Apache Iceberg's PyIceberg), we need to read Parquet files from cloud storage (S3/GCS/ADLS) in parallel across multiple threads. Each thread creates its own SessionContext and calls register_parquet().
Currently, cloud credentials must be set via os.environ before calling register_parquet() (the Rust object_store crate reads AWS_ACCESS_KEY_ID, etc. from the environment). Since os.environ is process-global, concurrent threads mutating it causes credential cross-contamination.
The workaround is a global threading.RLock() that serializes all file-based DataFusion operations — effectively negating the benefit of the thread pool. A scan over 200 S3 Parquet files runs ~4-8× slower than it should because only one thread can read at a time.
Describe the solution you'd like
Add an optional object_store parameter to register_parquet() (and other register_* / read_* methods) that accepts a pre-configured store instance:
Use register_object_store directly — This works for S3 (AmazonS3 accepts inline creds), but GoogleCloud only accepts service_account_path (no inline token/JSON), making it insufficient for GCS with ephemeral credentials.
Minimal fix — Add object_store= parameter to register_parquet that calls register_object_store internally after parsing the URL. This is ~20 lines of Python.
The AmazonS3, GoogleCloud, MicrosoftAzure classes already exist in datafusion.object_store — the gap is just the ergonomics of passing them to register_parquet and filling in GoogleCloud's credential options
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
When using
datafusion-pythonas a compute backend from multi-threaded Python applications (e.g., Apache Iceberg's PyIceberg), we need to read Parquet files from cloud storage (S3/GCS/ADLS) in parallel across multiple threads. Each thread creates its ownSessionContextand callsregister_parquet().Currently, cloud credentials must be set via
os.environbefore callingregister_parquet()(the Rustobject_storecrate readsAWS_ACCESS_KEY_ID, etc. from the environment). Sinceos.environis process-global, concurrent threads mutating it causes credential cross-contamination.The workaround is a global
threading.RLock()that serializes all file-based DataFusion operations — effectively negating the benefit of the thread pool. A scan over 200 S3 Parquet files runs ~4-8× slower than it should because only one thread can read at a time.Describe the solution you'd like
Add an optional
object_storeparameter toregister_parquet()(and otherregister_*/read_*methods) that accepts a pre-configured store instance:I know
register_object_store()already exists (and works!), but the two-step dance of register_object_store + register_parquet requires the caller to:A single
object_store=keyword onregister_parquetwould handle all of this internally.Current workaround (in a pending PyIceberg PR)
Describe alternatives you've considered
Additional context
AmazonS3,GoogleCloud,MicrosoftAzureclasses already exist indatafusion.object_store— the gap is just the ergonomics of passing them toregister_parquetand filling in GoogleCloud's credential options