Skip to content

Conversation

@nastra
Copy link
Contributor

@nastra nastra commented Oct 28, 2025

Without this fix the test would fail with

Cannot set current version to unknown version: 3
java.lang.IllegalArgumentException: Cannot set current version to unknown version: 3
	at org.apache.iceberg.relocated.com.google.common.base.Preconditions.checkArgument(Preconditions.java:190)
	at org.apache.iceberg.view.ViewMetadata$Builder.setCurrentVersionId(ViewMetadata.java:241)
	at org.apache.iceberg.view.TestViewMetadata.deduplicatingViewVersionByIdAndAssigningSchemaId(TestViewMetadata.java:991)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)

because the the ViewVersion was assigned a new ID and later when we tried to re-assign the schema ID, we used the wrong ViewVersion instance (the one where the version ID was not re-assigned).

Without this fix the test would fail with
```
Cannot set current version to unknown version: 3
java.lang.IllegalArgumentException: Cannot set current version to unknown version: 3
	at org.apache.iceberg.relocated.com.google.common.base.Preconditions.checkArgument(Preconditions.java:190)
	at org.apache.iceberg.view.ViewMetadata$Builder.setCurrentVersionId(ViewMetadata.java:241)
	at org.apache.iceberg.view.TestViewMetadata.deduplicatingViewVersionByIdAndAssigningSchemaId(TestViewMetadata.java:991)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
```
because the the `ViewVersion` was assigned a new ID and later when we tried to re-assign the schema ID, we used the wrong `ViewVersion` instance (the one where the version ID was not re-assigned).
@huaxingao huaxingao merged commit c4e480d into apache:main Oct 28, 2025
42 checks passed
@huaxingao
Copy link
Contributor

Thanks @nastra for the PR! Thanks @amogh-jahagirdar @singhpk234 for the review!

@nastra nastra deleted the fix-view-version-id-dedup-with-schema-assignment branch October 29, 2025 07:26
thomaschow pushed a commit to thomaschow/iceberg that referenced this pull request Jan 19, 2026
…ache#14434)

Without this fix the test would fail with
```
Cannot set current version to unknown version: 3
java.lang.IllegalArgumentException: Cannot set current version to unknown version: 3
	at org.apache.iceberg.relocated.com.google.common.base.Preconditions.checkArgument(Preconditions.java:190)
	at org.apache.iceberg.view.ViewMetadata$Builder.setCurrentVersionId(ViewMetadata.java:241)
	at org.apache.iceberg.view.TestViewMetadata.deduplicatingViewVersionByIdAndAssigningSchemaId(TestViewMetadata.java:991)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
```
because the the `ViewVersion` was assigned a new ID and later when we tried to re-assign the schema ID, we used the wrong `ViewVersion` instance (the one where the version ID was not re-assigned).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants