rdblue commented on code in PR #16425: URL: https://github.com/apache/iceberg/pull/16425#discussion_r4648626887
########## format/spec.md: ########## @@ -1203,13 +1206,13 @@ Values for `snapshot_id`, `sequence_number`, and `file_sequence_number` are inhe Manifests track the sequence number when a data or delete file was added to the table. -The `sequence_number` field represents the data sequence number. It is set when a file is added to the dataset and must not change unless a column file is added. The data sequence number represents a relative age of the file content and should be used for planning which delete files apply to a data file. +The `sequence_number` field represents the data sequence number. It is set when a file is added to the dataset and must not change unless a column file is added to a data file. The data sequence number represents a relative age of the file content and should be used for planning which delete files apply to a data file. The `file_sequence_number` field represents the sequence number of the snapshot that added the file and must also remain unchanged upon assigning at commit. The file sequence number can't be used for pruning delete files as the data within the file may have an older data sequence number. When adding a new file to a leaf manifest, its data and file sequence numbers are set to `null` because the snapshot's sequence number is not assigned until the snapshot is successfully committed. When reading, sequence numbers are inherited by replacing `null` with the manifest's sequence number from the snapshot root file. It is also possible to add a new file with data that logically belongs to an older sequence number. In that case, the data sequence number must be provided explicitly and not inherited. However, the file sequence number must be always assigned when the snapshot is successfully committed. -The data sequence number is inherited only if the entry status is ADDED, or MODIFIED by adding a column file. The file sequence number is inherited only if the entry status is ADDED. When writing an existing file to a new manifest or marking an existing file as deleted, the data and file sequence numbers must be non-null and set to the original values that were either inherited or provided at the commit time. +The data sequence number is inherited only if the entry status is ADDED, or MODIFIED by adding a column file to a data file. The file sequence number is inherited only if the entry status is ADDED. When writing an existing file to a new manifest or marking an existing file as deleted, the data and file sequence numbers must be non-null and set to the original values that were either inherited or provided at the commit time. Review Comment: I don't think this makes sense when read: "entry status is MODIFIED by adding a column file to a data file" ```suggestion The data sequence number is inherited only if the entry status is ADDED or MODIFIED. The file sequence number is inherited only if the entry status is ADDED. When writing an existing file to a new manifest or marking an existing file as deleted, the data and file sequence numbers must be non-null and set to the original values that were either inherited or provided at the commit time. When writing a MODIFIED data file, its data sequence number is set to `null` (inherit) only if its rows were changed by a column file. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
