Skip to content

Commit 3ed564c

Browse files
committed
[ntuple] Merger: add field version check to schema validation
1 parent 82185b4 commit 3ed564c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tree/ntuple/src/RNTupleMerger.cxx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,17 @@ CompareDescriptorStructure(const ROOT::RNTupleDescriptor &dst, const ROOT::RNTup
488488
errors.push_back(ss.str());
489489
}
490490

491+
// Require that field versions match
492+
const auto srcFldVer = field.fSrc->GetFieldVersion();
493+
const auto dstFldVer = field.fDst->GetFieldVersion();
494+
if (srcFldVer != dstFldVer) {
495+
std::stringstream ss;
496+
ss << "Field `" << field.fSrc->GetFieldName()
497+
<< "` has a different field version than previously-seen field with the same name (old: " << dstFldVer
498+
<< ", new: " << srcFldVer << ")";
499+
errors.push_back(ss.str());
500+
}
501+
491502
const auto srcRole = field.fSrc->GetStructure();
492503
const auto dstRole = field.fDst->GetStructure();
493504
if (srcRole != dstRole) {

0 commit comments

Comments
 (0)