Fokko commented on code in PR #16025:
URL: https://github.com/apache/iceberg/pull/16025#discussion_r4023957861


##########
format/spec.md:
##########
@@ -742,18 +758,126 @@ The `data_file` struct consists of the following fields:
     |            |            | _optional_ | **`144  content_offset`**         
| `long`                                                                      | 
The offset in the file where the content starts [5] |
     |            |            | _optional_ | **`145  content_size_in_bytes`**  
| `long`                                                                      | 
The length of a referenced content stored in the file; required if 
`content_offset` is present [5] |
 
-The `partition` struct stores the tuple of partition values for each file. Its 
type is derived from the partition fields of the partition spec used to write 
the manifest file. In v2, the partition struct's field ids must match the ids 
from the partition spec.
+    The `partition` struct stores the tuple of partition values for each file. 
Its type is derived from the partition fields of the partition spec used to 
write the manifest file. In v2, the partition struct's field ids must match the 
ids from the partition spec.
 
-The v4 `content_stats` container struct stores field-level metrics. Unlike the 
metrics maps, the type of `content_stats` is based on table metadata, like 
schema. Similar to the `partition` struct, the same type is used for all files 
tracked in a manifest.
+    Notes:
+
+    1. Single-value serialization for lower and upper bounds is detailed in 
Appendix D.
+    2. For `float` and `double`, the value `-0.0` must precede `+0.0`, as in 
the IEEE 754 `totalOrder` predicate. NaNs are not permitted as lower or upper 
bounds.
+    3. If sort order ID is missing or unknown, then the order is assumed to be 
unsorted. Only data files and equality delete files should be written with a 
non-null order id. [Position deletes](#position-delete-files) are required to 
be sorted by file and position, not a table order, and should set sort order id 
to null. Readers must ignore sort order id for position delete files.
+    4. Position delete metadata can use `referenced_data_file` when all 
deletes tracked by the entry are in a single data file. Setting the referenced 
file is required for deletion vectors.
+    5. The `content_offset` and `content_size_in_bytes` fields are used to 
reference a specific blob for direct access to a deletion vector. For deletion 
vectors, these values are required and must exactly match the `offset` and 
`length` stored in the Puffin footer for the deletion vector blob.
+    6. The following field ids are reserved on `data_file`: 141.
+
+=== "v4"
+    **Tracked Files**
+
+    | Field id | Name | Type | Required | Description |
+    |----------|------|------|----------|-------------|
+    | 134 | **`content_type`** | `int` (0: DATA, 3: DATA_MANIFEST, 4: 
DELETE_MANIFEST) | *required* | Type of content stored in the entry. |
+    | 157 | **`format_version`** | `int` (0: PRE-V4, 4: V4) | *required* | 
Writer format version. |
+    | 100 | **`location`** | `string` | *required* | Location of the file or 
manifest. |
+    | 101 | **`file_format`** | `string` | *required* | String file format 
name: `avro`, `orc`, `parquet`, or `puffin` |
+    | 147 | **`tracking`** | `tracking` struct | *required* | Groups status, 
snapshot, and sequence number. See tracking struct below. |
+    | 141 | **`spec_id`** | `int` | *optional* | ID of the partition spec used 
to write this manifest or data file. |
+    | 140 | **`sort_order_id`** | `int` | *optional* | ID representing sort 
order for this file. If missing or unknown, the order is assumed to be 
unsorted. |
+    | 103 | **`record_count`** | `long` | *required* | Number of records in 
this file. |
+    | 104 | **`file_size_in_bytes`** | `long` | *required* | Total file size 
in bytes. |
+    | 146 | **`content_stats`** | `content_stats` struct | *optional* | Column 
stats. See [Content Stats](#content-stats). |
+    | 150 | **`manifest_info`** | `manifest_info` struct | *optional* | See 
manifest_info struct below. |
+    | 131 | **`key_metadata`** | `binary` | *optional* | 
Implementation-specific key metadata for encryption. |
+    | 132 | **`split_offsets`** | `list<133: long>` | *optional* | Split 
offsets for the data file. Must be sorted ascending. |
+    | 148 | **`deletion_vector`** | `deletion_vector` struct | *optional* | 
Row-level deletion vector for a data file. |
+    | 158 | **`column_files`** | `list<159: column_file>` | *optional* | 
Column update files associated with this entry. |
+
+    **`tracking` struct (field 147)**
+
+    | Field id | Name | Type | Required | Description |
+    |----------|------|------|----------|-------------|
+    | 0 | **`status`** | `int` (0: EXISTING, 1: ADDED, 2: DELETED, 3: 
REPLACED, 4: MODIFIED) | *required* | Used to track additions, deletions, 
replacements, and modifications. Deletes are not used in scans. |
+    | 1 | **`snapshot_id`** | `long` | *optional* | Snapshot ID where the file 
was added or deleted. Inherited when null. |
+    | 5 | **`dv_snapshot_id`** | `long` | *optional* | Snapshot ID where the 
deletion vector was added. |

Review Comment:
   ```suggestion
       | 5 | **`dv_snapshot_id`** | `long` | *optional* | Snapshot ID where the 
deletion vector was added or updated. |
   ```



-- 
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]

Reply via email to