Skip to content

Commit c2dac70

Browse files
committed
Document nesting of types
1 parent 9cbca08 commit c2dac70

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
@@ -12,3 +12,41 @@
1212
* [`unordered_set`](unordered_set): `std::unordered_set` with all `[Split]Index{32,64}` column types
1313
* [`variant`](variant): `std::variant` with `Switch` column type
1414
* [`vector`](vector): `std::vector` with all `[Split]Index{32,64}` column types
15+
16+
## Nesting of Types
17+
18+
In the RNTuple Validation Suite, we cannot test all possible nesting combinations of supported types.
19+
Furthermore, we assume that the column encoding on disk is orthogonal to the nesting of fields.
20+
We therefore cover a strategic selection based on field structural roles that is described below.
21+
Implementations should exercise specific details related to nesting of types in their own unit tests.
22+
In particular, this includes any optimization that contradicts the assumptions made above.
23+
24+
### Leaf Fields
25+
26+
For leaf fields, we test all possible column encodings in a top-level field.
27+
28+
### Collection Fields
29+
30+
For collection fields (for example `std::vector`), we want to test all `[Split]Index{32,64}` column types.
31+
32+
If `C` is a container type with a single item field, we test the following nestings:
33+
* `C<std::int32_t>`
34+
* `C<C<std::int32_t>>`
35+
36+
If `M` is an dictionary container type, we test the following nestings:
37+
* `M<std::int32_t, std::int32_t>`
38+
* `M<M<std::int32_t, std::int32_t>, M<std::int32_t, std::int32_t>>`
39+
40+
### Record Fields
41+
42+
For record fields of type `R` (for example `std::tuple`), we want to test nesting with other field structural roles:
43+
* Leaf fields of types `std::int32_t` and `std::string` (the latter is particular because it has variable length and two columns)
44+
* Variant field of type `std::variant<std::int32_t, std::string>`
45+
* Collection field of type `std::vector<std::int32_t>`
46+
* Record field of the type `R` itself
47+
48+
In addition, we test the nesting of the record type inside a collection field, `std::vector<R>`.
49+
50+
### Variant Fields
51+
52+
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)