Skip to content

[POC] refactor(writer)!: make location generators trait objects - #3738

Draft
smaheshwar-pltr wants to merge 1 commit into
apache:mainfrom
smaheshwar-pltr:location-generator/dyn-trait-poc
Draft

smaheshwar-pltr wants to merge 1 commit into
apache:mainfrom
smaheshwar-pltr:location-generator/dyn-trait-poc

Conversation

@smaheshwar-pltr

@smaheshwar-pltr smaheshwar-pltr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

This is a breaking POC of location generators being trait objects. See the changelog for details on what would break.

See smaheshwar-pltr/iceberg-rust@location-generator/dyn-trait-poc...location-generator/dyn-trait-poc-custom-providers for changes on top of this PR to support custom location providers - trait objects make that convenient.

Which issue does this PR close?

  • Closes #.

What changes are included in this PR?

Are these changes tested?

AI Disclosure

LocationGenerator no longer requires Clone, so a generator chosen at
runtime can be an Arc<dyn LocationGenerator>. Writers store one instead
of taking a location generator type parameter, and
Table::location_generator returns the generator for the layout the
table properties select.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment on lines +341 to +345
/// The layout follows
/// [`write.object-storage.enabled`](crate::spec::TableProperties::PROPERTY_WRITE_OBJECT_STORAGE_ENABLED);
/// see [`ObjectStorageLocationGenerator`](crate::writer::file_writer::location_generator::ObjectStorageLocationGenerator)
/// and [`DefaultLocationGenerator`](crate::writer::file_writer::location_generator::DefaultLocationGenerator).
/// Java's `write.location-provider.impl` is not supported and is ignored.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes from #3730 are included here to show what that flow would look like with this design instead. This adds custom location providers on top.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant