apache / iceberg-python

Apache PyIceberg
https://py.iceberg.apache.org/
Apache License 2.0
309 stars 114 forks source link

Support LocationProviders like the Java Iceberg Reference Implementaiton #861

Open corleyma opened 6 days ago

corleyma commented 6 days ago

Feature Request / Improvement

The Iceberg Java API supports customizing where data files are written using LocationProviders. By default, Iceberg writes data files following a Hive schema. However, table properties can be used to switch to using a built-in ObjectStoreLocationProvider that is optimized to maximize throughput on object storage. It's also possible to provide your own custom LocationProviders.

I think for write parity between pyiceberg and Spark, it's important for pyiceberg to at least support the ObjectStoreLocationProvider functionality. Here's the Java implementation, and here's the current logic in pyiceberg which seems to only mimic the default locationprovider.

While AWS S3 has since revised their guidance about the necessity of injecting randomness into prefixes, that guidance still holds for other object stores like GCS, so in addition to being required for parity I think this feature is still important for performance too.

kevinjqliu commented 6 days ago

+1 on adding LocationProviders. It's useful for configuring writes for data files and gives flexibility in writing. Would be great to make it pluggable just like FileIO