Skip to content

Commit 8f60d12

Browse files
committed
Document nesting of types
1 parent a91c84c commit 8f60d12

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

types/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,41 @@
66
* [`unique_ptr`](unique_ptr): `std::unique_ptr` with different element types
77
* [`variant`](variant): `std::variant` with `Switch` column type
88
* [`vector`](vector): `std::vector` with all `[Split]Index{32,64}` column types
9+
10+
## Nesting of Types
11+
12+
In the RNTuple Validation Suite, we cannot test all possible nesting combinations of supported types.
13+
Furthermore, we assume that the column encoding on disk is orthogonal to the nesting of fields.
14+
We therefore cover a strategic selection based on field structural roles that is described below.
15+
Implementations are required to exercise specific details in their own unit tests.
16+
In particular, this includes any optimization that contradicts the assumptions made above.
17+
18+
### Leaf Fields
19+
20+
For leaf fields, we test all possible column encodings in a top-level field.
21+
22+
### Collection Fields
23+
24+
For collection fields (for example `std::vector`), we want to test all `[Split]Index{32,64}` column types.
25+
26+
If `C` is a container type with a single item field, we test the following nestings:
27+
* `C<std::int32_t>`
28+
* `C<C<std::int32_t>>`
29+
30+
If `M` is an dictionary container type, we test the following nestings:
31+
* `M<std::int32_t, std::int32_t>`
32+
* `M<M<std::int32_t, std::int32_t>, M<std::int32_t, std::int32_t>>`
33+
34+
### Record Fields
35+
36+
For record fields of type `R` (for example `std::tuple`), we want to test nesting with other field structural roles:
37+
* Leaf fields of types `std::int32_t` and `std::string` (the latter is particular because it has variable length and two columns)
38+
* Variant field of type `std::variant<std::int32_t, std::string>`
39+
* Collection field of type `std::vector<std::int32_t>`
40+
* Record field of the type `R` itself
41+
42+
In addition, we test the nesting of the record type inside a collection field, `std::vector<R>`.
43+
44+
### Variant Fields
45+
46+
As there is only one type that results in this field structural role, the reader is referred to the [`variant`](variant) directory.

0 commit comments

Comments
 (0)