Skip to content

feat(catalog): Implement update_table for MemoryCatalog #1549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 27, 2025

Conversation

CTTY
Copy link
Contributor

@CTTY CTTY commented Jul 24, 2025

Which issue does this PR close?

What changes are included in this PR?

  • Implemented update_table for MemoryCatalog
  • Cherry-picked the metadata parsing logic and some parts of update_table impl from feat(catalog): Implement MemoryCatalog's table update/ commit path #1405
    • Metadata parsing logic is put under MetadataLocationParser
  • Switch to use MetadataLocationParser for multiple catalogs, and remove the previous metadata location generator
  • Fixed an issue with TableCommit::apply that causes it not updating MetadataLog

Are these changes tested?

Added unit tests

@CTTY CTTY marked this pull request as ready for review July 24, 2025 04:23
Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

Thanks @CTTY for this pr! Generally looks good, but I would suggest to move the refactoring of MetadataLocation to a separate pr.

.metadata()
.write_to(
staged_table.file_io(),
staged_table.metadata_location().unwrap(),
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not panic here. Also I think we should generate a new table metadata location?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new metadata location would be generated in TableCommit::apply and attached to the staged table

Copy link
Contributor

Choose a reason for hiding this comment

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

The mod name utils is too generic. We should rename it to metadata_location or sth more meaningful.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also I would suggest to move this into a separate pr.

Copy link
Contributor Author

@CTTY CTTY Jul 24, 2025

Choose a reason for hiding this comment

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

How about we only move the usages of MetadataLocation in catalogs other than MemoryCatalog to a different PR, and have MemoryCatalog switch to use MetadataLocation in this PR?

Because we need to use MetadataLocation::with_next_version to bump metadata location version when updating a table, and it would require some cumbersome + temporary logic if without MetadataLocation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed MetadataLocation usages for catalogs other than MemoryCatalog

Copy link
Contributor

Choose a reason for hiding this comment

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

I still prefer to move it to another pr, but I don't have a strong opinion on it. Currently changes also looks good to me.

Copy link
Contributor

@DerGut DerGut left a comment

Choose a reason for hiding this comment

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

Thanks for taking this back on! I only found some minor issues around comments. Looks good to me otherwise 👏

@liurenjie1024
Copy link
Contributor

We have just one minor change to resolve.

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

Thanks @CTTY for this pr, LGTM!

@liurenjie1024 liurenjie1024 merged commit d5e8348 into apache:main Jul 27, 2025
17 checks passed
@CTTY CTTY deleted the ctty/update-table branch July 28, 2025 00:45
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.

3 participants