Skip to content

Core: Implement table refs in TableMetadataParser - #4260

Merged
rdblue merged 5 commits into
apache:masterfrom
rdblue:add-refs-to-metadata-parser
Mar 8, 2022
Merged

rdblue merged 5 commits into
apache:masterfrom
rdblue:add-refs-to-metadata-parser

Conversation

@rdblue

@rdblue rdblue commented Mar 3, 2022

Copy link
Copy Markdown
Contributor

This updates TableMetadataParser to read and write the refs map.

@github-actions github-actions Bot added the core label Mar 3, 2022
@rdblue
rdblue requested a review from jackye1995 March 3, 2022 17:37
@rdblue
rdblue force-pushed the add-refs-to-metadata-parser branch from fc51741 to 0881f61 Compare March 3, 2022 19:08

@nastra nastra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

changes LGTM once CI passes

currentSnapshotId, main != null ? main.snapshotId() : null);
} else {
Preconditions.checkArgument(main == null,
"Current snapshot is not set, but main branch exists: %s", main);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: should this mention ...snapshot ID is not set... to be consistent with the error message above?

SnapshotRef main = inputRefs.get(SnapshotRef.MAIN_BRANCH);
if (currentSnapshotId != -1) {
Preconditions.checkArgument(main == null || currentSnapshotId == main.snapshotId(),
"Current snapshot ID does not match main branch (%s != %s)",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: I wonder if the message would be slightly clearer like this: Current snapshot ID '%s' does not match the snapshot ID '%s' of the main branch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I strongly prefer keeping the error message itself readable and adding context after. While it is more clear which ID is which in your version, I think it makes the actual problem harder to read because there are longs embedded in the text.

@kbendick kbendick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1. This looks good to me once tests are passing.

@danielcweeks danielcweeks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@rdblue
rdblue merged commit 5eb0699 into apache:master Mar 8, 2022
@rdblue

rdblue commented Mar 8, 2022

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews, everyone!

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