pvary commented on code in PR #18416: URL: https://github.com/apache/iceberg/pull/18416#discussion_r4616649554
########## format/spec.md: ########## @@ -308,6 +310,34 @@ For details on how to serialize a schema to JSON, see Appendix C. [1001]: <https://portal.ogc.org/files/?artifact_id=25355> "OGC Simple feature access" +##### Vector + +A non-null `vector(E, D)` contains exactly D elements of element type E, and every element is non-null. The vector value may be null only when the vector field is optional. + +E must be one of the following vector element types: + +| Element type | Element values | Value type | +|---------------|--------------------------------------------------------------------|------------| +| **`int`** | 32-bit signed integers | `int` | +| **`long`** | 64-bit signed integers | `long` | +| **`float16`** | `float` values that are exactly representable as IEEE 754 binary16 | `float` | +| **`float`** | 32-bit IEEE 754 floating point | `float` | +| **`double`** | 64-bit IEEE 754 floating point | `double` | + +Vector element types are valid only inside a `vector`; `float16` is not a primitive type and cannot be used as the type of a field. Element values follow the rules of the value type, including JSON single-value serialization. Vector equality is element-wise, using the equality rules of the value type. Floating-point elements must be finite: `NaN`, `+Infinity`, and `-Infinity` are invalid. + +The element type of a `vector(E, D)` may be promoted according to the following table. The dimension D and the vector field ID must not change. + +| Element type | Permitted promotion targets | +|--------------|-----------------------------| +| `int` | `long` | +| `float16` | `float`, `double` | +| `float` | `double` | Review Comment: nit: Hurts my eyes for the new tables. Sry: ```suggestion | Element type | Element values | Value type | |---------------|--------------------------------------------------------------------|------------| | **`int`** | 32-bit signed integers | `int` | | **`long`** | 64-bit signed integers | `long` | | **`float16`** | `float` values that are exactly representable as IEEE 754 binary16 | `float` | | **`float`** | 32-bit IEEE 754 floating point | `float` | | **`double`** | 64-bit IEEE 754 floating point | `double` | Vector element types are valid only inside a `vector`; `float16` is not a primitive type and cannot be used as the type of a field. Element values follow the rules of the value type, including JSON single-value serialization. Vector equality is element-wise, using the equality rules of the value type. Floating-point elements must be finite: `NaN`, `+Infinity`, and `-Infinity` are invalid. The element type of a `vector(E, D)` may be promoted according to the following table. The dimension D and the vector field ID must not change. | Element type | Permitted promotion targets | |--------------|-----------------------------| | `int` | `long` | | `float16` | `float`, `double` | | `float` | `double` | ``` -- 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]
