Skip to content

[ntuple] Support reading alternative types through the RNTupleProcessor#21462

Open
enirolf wants to merge 6 commits intoroot-project:masterfrom
enirolf:ntuple-processor-alternative-types
Open

[ntuple] Support reading alternative types through the RNTupleProcessor#21462
enirolf wants to merge 6 commits intoroot-project:masterfrom
enirolf:ntuple-processor-alternative-types

Conversation

@enirolf
Copy link
Copy Markdown
Contributor

@enirolf enirolf commented Mar 3, 2026

This changes requires moving the ownership of all fields from an internally stored RNTupleModel in each processor (fProtoModel) to the RNTupleProcessorEntry. In turn, potential namin conflicts when auxiliary RNTuples in a join have the same name as a field in the primary RNTuple are now also handled differently, since this used to rely on the fProtoModel.

This change implicitly adds proper support for requesting subfields, for which tests have been added.

@enirolf enirolf self-assigned this Mar 3, 2026
@enirolf enirolf requested a review from jblomer as a code owner March 3, 2026 10:48
@enirolf enirolf changed the title [ntuple] Support alternative types in RNTupleProcessor [ntuple] Support reading alternative types through the RNTupleProcessor Mar 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

Test Results

    22 files      22 suites   3d 4h 24m 18s ⏱️
 3 830 tests  3 827 ✅  1 💤 2 ❌
76 513 runs  76 493 ✅ 18 💤 2 ❌

For more details on these failures, see this check.

Results for commit 2630d07.

♻️ This comment has been updated with latest results.

@enirolf enirolf marked this pull request as draft March 4, 2026 07:42
@enirolf enirolf force-pushed the ntuple-processor-alternative-types branch from ec4f94c to 091710b Compare March 4, 2026 10:12
@enirolf enirolf marked this pull request as ready for review March 4, 2026 12:10
Comment thread tree/ntuple/inc/ROOT/RNTupleProcessor.hxx
Comment thread tree/ntuple/inc/ROOT/RNTupleProcessorEntry.hxx Outdated
Comment thread tree/ntuple/inc/ROOT/RNTupleProcessorEntry.hxx
std::vector<RProcessorValue> fProcessorValues;
std::unordered_map<std::string, FieldIndex_t> fFieldName2Index;
// Maps from the field name to all type alternatives for that field that have been added to the entry.
std::unordered_map<std::string, std::unordered_set<FieldIndex_t>> fFieldName2Index;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about using an unordered_set here: unless we expect hundreds of alternative types for a single field, a vector is probably gonna be much faster (especially if the most common case is a single element in it)

Comment thread tree/ntuple/src/RNTupleProcessor.cxx Outdated
Comment thread tree/ntuple/inc/ROOT/RNTupleProcessorEntry.hxx
Comment thread tree/ntuple/inc/ROOT/RNTupleProcessorEntry.hxx
Comment thread tree/ntuple/src/RNTupleProcessor.cxx Outdated
@enirolf enirolf force-pushed the ntuple-processor-alternative-types branch from 091710b to 746a870 Compare April 1, 2026 13:40
@enirolf enirolf requested review from hahnjo and silverweed April 1, 2026 13:41
Copy link
Copy Markdown
Member

@hahnjo hahnjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread tree/ntuple/src/RNTupleProcessor.cxx Outdated
enirolf added 6 commits April 13, 2026 17:02
This changes requires moving the ownership of all fields from an
internally stored `RNTupleModel` in each processor (`fProtoModel`) to
the `RNTupleProcessorEntry`. Full removal of `fProtoModel` is taken
car of in the next commit. This change also enables proper handling of
subfields, for wich a test will be added in a separate commit.
To enable this, an additional prefix needed to be added to distinguish
them internally from regular fields that have been added explicitly by
the user.
This change also includes a different way to handle field/processor
naming conflicts, which previously relied on the `fProtoModel`, plus an
additional test for this
To make sure that fields of "second chains" are also added correctly to
the processor.
@enirolf enirolf force-pushed the ntuple-processor-alternative-types branch from 746a870 to 2630d07 Compare April 13, 2026 15:32
@enirolf enirolf added the clean build Ask CI to do non-incremental build on PR label Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clean build Ask CI to do non-incremental build on PR in:RNTuple

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants