Skip to content

Conversation

@nastra
Copy link
Contributor

@nastra nastra commented Apr 29, 2025

#12882 went in right in between voting on 1.9.0 happened, which means that the API breakage wasn't detected as a breakage when it was merged. After upgrading RevAPI to compare against 1.9.0, the API breakage around Map -> SerializableMap was flagged.
The underlying issue is that Immutables will always create an unmodifiable Map (which isn't configurable and is generally what you want) when the API definition is Map, which Kryo can't deal with, since Kryo adds back elements to the collection after deserialization. There is some hope that Kryo will eventually be able to deal with unmodifiable collections without having to use a separate kryo-serializers lib (EsotericSoftware/kryo#1154) but we're not there yet and maybe the better option would have been to not make StorageCredential use Immutables in the first place due to Kryo.

This PR adds the generated ImmutableStorageCredential class to the codebase and creates a SerializableMap instead of an unmodifiable one in order to work with Kryo and also to avoid the API breakage

static StorageCredential create(String prefix, Map<String, String> config) {
return ImmutableStorageCredential.builder()
.prefix(prefix)
.config(SerializableMap.copyOf(config))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

a SerializableMap will be created internally by the builder

@nastra nastra force-pushed the fix-api-breakage branch from 09e3b5f to bec4862 Compare May 6, 2025 07:16
@nastra nastra requested a review from danielcweeks May 6, 2025 07:18
Copy link
Contributor

@danielcweeks danielcweeks left a comment

Choose a reason for hiding this comment

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

LGTM

@danielcweeks danielcweeks merged commit c730c0b into apache:main May 7, 2025
43 checks passed
@nastra nastra deleted the fix-api-breakage branch May 7, 2025 15:31
devendra-nr pushed a commit to devendra-nr/iceberg that referenced this pull request Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants