BigQuery metastore: implement commit_table with commit status verification#3099
Open
jx2lee wants to merge 3 commits intoapache:mainfrom
Open
BigQuery metastore: implement commit_table with commit status verification#3099jx2lee wants to merge 3 commits intoapache:mainfrom
jx2lee wants to merge 3 commits intoapache:mainfrom
Conversation
Contributor
|
@rambleraptor could you take a look at this? |
geruh
reviewed
Feb 27, 2026
| ) | ||
| current_metadata_location = parameters.get(METADATA_LOCATION_PROP) | ||
| if current_metadata_location == new_metadata_location: | ||
| return "SUCCESS" |
Member
There was a problem hiding this comment.
nit: can we extract the status to enum?
| raise commit_error | ||
|
|
||
| if current_table: | ||
| self._delete_old_metadata(updated_staged_table.io, current_table.metadata, updated_staged_table.metadata) |
Member
There was a problem hiding this comment.
_delete_old_metadata is already called in table once the commit table is returned in table class.
https://github.com/apache/iceberg-python/blob/main/pyiceberg/table/__init__.py#L1507
| metadata_path=updated_staged_table.metadata_location, | ||
| ) | ||
|
|
||
| commit_error: Exception | None = None |
Member
There was a problem hiding this comment.
Nit: non blocking it's more of an implementation detail but with the java implementation they are preventing orphaned metadata on commit failure. This doesn't affect table state, just maybe a nice to have.
I'll let @rambleraptor chime in here.
| current_metadata = FromInputFile.table_metadata(io.new_input(current_metadata_location)) | ||
|
|
||
| previous_metadata_locations = {log.metadata_file for log in current_metadata.metadata_log} | ||
| previous_metadata_location = parameters.get(PREVIOUS_METADATA_LOCATION_PROP) |
Contributor
|
Sorry I haven't taken a look at this! I'll take a look on Monday |
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.
Closes #2893
Rationale for this change
BigQueryMetastoreCatalog.commit_tablewas not implemented.This PR implements
commit_tablefor the BigQuery metastore catalog with:metadata_log)Are these changes tested?
Yes.
uv run pytest -q tests/catalog/test_bigquery_metastore.py -qAre there any user-facing changes?
Maybe no.