Skip to content

Conversation

@rdblue
Copy link
Contributor

@rdblue rdblue commented Apr 9, 2020

Adds sequence numbers to JSON metadata in the v2 write path.

@rdblue rdblue force-pushed the v2-snapshot-metadata branch from 94f92d7 to 3d8e22c Compare April 10, 2020 00:04
@chenjunjiedada
Copy link
Collaborator

chenjunjiedada commented Apr 10, 2020

Look great! +1.

I will rebase #588 once this get in.

Preconditions.checkArgument(formatVersion == 1 || uuid != null,
"UUID is required in format v%s", formatVersion);
Preconditions.checkArgument(formatVersion > 1 || lastSequenceNumber == 0,
"Sequence number must be 0 in v1: %s", lastSequenceNumber);
Copy link
Contributor

Choose a reason for hiding this comment

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

So, v1 writers will only be allowed to write sequence numbers as 0 and we will assume 0 as sequence numbers in metadata entities without an explicit value, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

V1 writers should not pass any sequence number other than 0, and it won't get written to the file even though it is compatible. And reading v1 metadata should always fill in the sequence number with 0.

Copy link
Contributor

@aokolnychyi aokolnychyi left a comment

Choose a reason for hiding this comment

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

+1

@aokolnychyi aokolnychyi merged commit 720b240 into apache:master Apr 10, 2020
@rdblue rdblue added this to the Row-level Delete milestone May 8, 2020
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