Skip to content

Conversation

jblomer
Copy link
Contributor

@jblomer jblomer commented Sep 9, 2025

Includes automatic schema evolution for std::pair and std::tuple, which are implemented as descendants of the RRecordField.

Fixes #19254

@jblomer jblomer self-assigned this Sep 9, 2025
@jblomer jblomer changed the title [ntuple] fix automatic schema evolution of record fields [ntuple] Fix automatic schema evolution of record fields Sep 9, 2025
@jblomer jblomer force-pushed the ntuple-fix-record-evolution branch from 606a7d8 to 1217e71 Compare September 9, 2025 10:32
Copy link

github-actions bot commented Sep 9, 2025

Test Results

    21 files      21 suites   3d 13h 55m 28s ⏱️
 3 667 tests  3 404 ✅   0 💤 263 ❌
75 024 runs  74 431 ✅ 330 💤 263 ❌

For more details on these failures, see this check.

Results for commit 42e5bbc.

♻️ This comment has been updated with latest results.

Copy link
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.

Looks mostly good to me, two small comments.

@jblomer jblomer force-pushed the ntuple-fix-record-evolution branch from 1217e71 to 7590380 Compare September 15, 2025 13:04
@jblomer jblomer force-pushed the ntuple-fix-record-evolution branch from 7590380 to 67a9de2 Compare September 15, 2025 21:26
For std::pair and std::tuple, check that the number of subfields in
memory and on disk is identical. For 2 subfields, std::pair and
std::tuple are interchangible. The pair/tuple elements don't need to be
an exact match but are themselves subject to automatic schema evolution.
The privileged access of RClassField to RFieldBase is used to modify
some properties of its subfields. Make this more targeted through
protected methods.

One of the methods, CallSetArtificialOn(), will be reused by the record
field.
Ensure that record field evolution supports missing fields, reordered
fields, and added fields. Mark added fields as artificial (which was
missing before).
Prevent pair and tuple fields from being demoted to record fields by
adding their own CloneImpl() overrides.
Record fields are used for
  1) untyped records
  2) emulated classes and as
  3) base class for the pair and tuple fields.

These three cases use different constructors and have different
reconciliation logic wrt. to the on-disk information.

Make this more clear through code comments. Shortcut reconciliation for
emulated fields.
@jblomer jblomer force-pushed the ntuple-fix-record-evolution branch from 67a9de2 to 42e5bbc Compare September 15, 2025 21:55
Copy link
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, thanks!

@jblomer jblomer merged commit c98110a into root-project:master Sep 16, 2025
24 of 26 checks passed
@jblomer jblomer deleted the ntuple-fix-record-evolution branch September 16, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ntuple] Schema evolution of record fields
3 participants