iceberg-python icon indicating copy to clipboard operation
iceberg-python copied to clipboard

Support LocationProviders like the Java Iceberg Reference Implementaiton

Open corleyma opened this issue 1 year ago • 1 comments

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.

corleyma avatar Jun 26 '24 18:06 corleyma

+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

kevinjqliu avatar Jun 27 '24 00:06 kevinjqliu

I think this is a great idea! Would love to work on this if no one is assigned yet 😄

smaheshwar-pltr avatar Dec 19 '24 03:12 smaheshwar-pltr

@smaheshwar-pltr I don't think anyone started on this, feel free to pick this up, I'm happy to review!

Fokko avatar Dec 19 '24 09:12 Fokko

Great! I've put up https://github.com/apache/iceberg-python/pull/1452 that should address this

smaheshwar-pltr avatar Dec 23 '24 15:12 smaheshwar-pltr