Spec: Add added-rows field to Snapshot#11976
Merged
RussellSpitzer merged 4 commits intoapache:mainfrom Jan 17, 2025
Merged
Conversation
stevenzwu
approved these changes
Jan 15, 2025
dramaticlly
reviewed
Jan 16, 2025
format/spec.md
Outdated
| | _optional_ | _required_ | _required_ | **`summary`** | A string map that summarizes the snapshot changes, including `operation` (see below) | | ||
| | _optional_ | _optional_ | _optional_ | **`schema-id`** | ID of the table's current schema when the snapshot was created | | ||
| | | | _optional_ | **`first-row-id`** | The first `_row_id` assigned to the first row in the first data file in the first manifest, see [Row Lineage](#row-lineage) | | ||
| | | | _optional | **`added-rows`** | The number of newly added rows in this snapshot. Required if [Row Lineage](#row-lineage) is enabled | |
Contributor
There was a problem hiding this comment.
format nit:
- missing trailing underscore from
_optional - 5th and 6th
|seem to be misaligned from rows above
Member
Author
There was a problem hiding this comment.
Normally we don't do the vertical alignment, but it's pretty easy here so i'll fix it
dramaticlly
approved these changes
Jan 16, 2025
sfc-gh-aixu
approved these changes
Jan 17, 2025
Contributor
sfc-gh-aixu
left a comment
There was a problem hiding this comment.
That makes sense to me.
amogh-jahagirdar
approved these changes
Jan 17, 2025
Fokko
approved these changes
Jan 17, 2025
danielcweeks
approved these changes
Jan 17, 2025
Member
Author
|
Merged, Thanks @sfc-gh-aixu, @amogh-jahagirdar , @dramaticlly , @danielcweeks , @stevenzwu , @Fokko for reviewing! |
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.
Split out from #11948
Working on the row-lineage implementation made it clear that we needed a way to get information from the Snapshot object propagated into the Metadata layer. Specifically we need to know the count of all newly added rows in that Snapshot to change the
last-row-idof the TableMetadata. While we can potentially read this from Snapshot Summary, it would be a bit odd to have a requirement on key value pair within Snapshot summary. We could also potentially re-read and calculate the number of added rows, but this would require re-opening the manifest list itself.I believe it makes more sense to formally have added-rows as an optional field within the Snapshot itself so we can make it clear in the spec this value is expected to be stored within the Snapshot metadata if row-lineage is enabled.