fix: automatically migrate V0 SqlCatalog catalog tables#2380
Open
rchowell wants to merge 1 commit intoapache:mainfrom
Open
fix: automatically migrate V0 SqlCatalog catalog tables#2380rchowell wants to merge 1 commit intoapache:mainfrom
rchowell wants to merge 1 commit intoapache:mainfrom
Conversation
blackmwk
reviewed
Apr 29, 2026
| .map_err(from_sqlx_error)?; | ||
|
|
||
| // Check if the catalog table has the iceberg_type column, if not, it's a V0 schema. | ||
| let needs_migration = sqlx::query(&format!( |
Contributor
There was a problem hiding this comment.
I don't think it's a good idea to do migration silently. We should do followings:
- Add a config to do auto migration if need, and this should be disabled by default.
- If auto migration is disabled, and we detected that it's v0, we should return error.
- Add a pub api in SqlCatalog to allow user to do migration.
Contributor
Author
There was a problem hiding this comment.
I agree, however this is the same behavior as iceberg-java which by default does auto-migration. https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java#L157
I am happy to change this if you still believe iceberg-rust should have a different behavior. Any thoughts on the config name since it does not exist in other libs?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
What changes are included in this PR?
Probe to see if we have a V0 or V1 table, then add the iceberg_type column if it does not exist. More details in apache/iceberg-python#3263
Are these changes tested?