Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip-ci][ntuple] Clarify collection proxy specifications #16688

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions tree/ntuple/v7/doc/specifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ While STL (unordered) (multi)sets by definition are associative containers
on disk they are represented as sequential collections.
This means that they have the same on-disk representation as `std::vector<T>`, using two fields:
- Collection parent field whose principal column is of type `(Split)Index[64|32]`.
- Child field of type `T`, which must by a type with RNTuple I/O support.
- Child field of type `T`, which must be a type with RNTuple I/O support.
The name of the child field is `_0`.

#### std::map\<K, V\>, std::unordered_map\<K, V\>, std::multimap\<K, V\>, std::unordered_multimap\<K, V\>
Expand Down Expand Up @@ -988,13 +988,16 @@ The field name of base class subfields are numbered and preceded by a colon (`:`
#### Classes with an associated collection proxy

User classes that specify a collection proxy behave as collections of a given value type.
Associative collections are not currently supported.

The on-disk representation is similar to a `std::vector<T>` where `T` is the value type;
specifically, it is stored as two fields:
The on-disk representation of non-associative collections is identical to a `std::vector<T>`, using two fields:
- Collection parent field whose principal column is of type `(Split)Index[64|32]`.
- Child field of type `T`, which must by a type with RNTuple I/O support.
The name of the child field is `_0`.
- Child field of type `T`, which must be a type with RNTuple I/O support.

The on-disk representation of associative collections is identical to a `std::map<K, V>`, using two fields:
- Collection parent field whose principal column is of type `(Split)Index[64|32]`.
- Child field of type `std::pair<K, V>`, where `K` and `V` must be types with RNTuple I/O support.

N.B., proxy-based associative collections are supported in the RNTuple binary format, but currently are not implemented in ROOT's RNTuple reader and writer. This will be added in the future.

### ROOT::Experimental::RNTupleCardinality<SizeT>

Expand Down