etseidl commented on code in PR #585:
URL: https://github.com/apache/parquet-format/pull/585#discussion_r3391753789
##########
LogicalTypes.md:
##########
@@ -635,7 +635,76 @@ The type has two type parameters:
The sort order used for `GEOGRAPHY` is undefined. When writing data, no min/max
statistics should be saved for this type and if such non-compliant statistics
-are found during reading, they must be ignored.
+are found during reading, they must be ignored.
+
+### FILE
+
+`FILE` annotates a group that represents a reference to an external file,
along with
+the minimum metadata required to read it. It is intended for use cases such as
+storing file inventories, manifests, and unstructured data references (e.g.,
images
+or audio files stored in object storage).
+
+The annotated group must contain the following fields, identified by name.
Field IDs
+may also be used for projection:
+
+| Field | Type | Required |
+|----------|--------|----------|
+| `path` | STRING | Yes |
+| `size` | INT64 | No |
+| `offset` | INT64 | No |
+| `etag` | STRING | No |
+
+#### Fields
+
+##### path
+
+An opaque path string to the referenced file (e.g., `s3://bucket/file.jpg`).
No special
+encoding (e.g., URI encoding) is applied. This is the only required field.
+
+##### size
+
+The length of the content in bytes. Must be zero or a positive integer if
provided.
+A value of 0 indicates an empty file. If not provided, the length of the
referenced
+content is unknown and the entirety of the content can be read.
+
+##### offset
+
+A byte offset indicating the start of a content slice within the referenced
file.
+If not provided, readers must treat the value as 0.
+If provided and non-zero, readers must seek to this offset and read `size`
bytes to retrieve the referenced data.
+If `offset` is provided, `size` must also be provided.
Review Comment:
Again, looking at the implementation in Rust, I don't see this enforced.
What if the group definition is
```
optional group my_file (FILE) {
required binary path (STRING);
optional int64 offset;
}
```
I think we need to specify this at both the field and data levels, i.e. if
the group contains an 'offset' field, it must also contain a 'size' field; if
the optional 'offset' field is populated, it must be a non-negative integer,
and a value for 'size' must also present.
Edit: I think the `MAP` description in this file is a good example of what
I'm wanting here:
> - The key field encodes the map's key type. This field must have
repetition required and must always be present. It must always be the first
field of the repeated key_value group.
> - The value field encodes the map's value type and repetition. This field
can be required, optional, or omitted. It must always be the second field of
the repeated key_value group if present. If not present, it can be represented
as a map with all null values or as a set of keys.
--
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]