Skip to content

Commit 4ba4e83

Browse files
committed
[ntuple] Fix AddExtendedColumnRanges to account for ExtendColumns
1 parent 4aa1007 commit 4ba4e83

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

tree/ntuple/src/RNTupleDescriptor.cxx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,16 @@ ROOT::Internal::RClusterDescriptorBuilder::AddExtendedColumnRanges(const RNTuple
961961
// `ROOT::RFieldBase::EntryToColumnElementIndex()`, i.e. it is a principal column reachable from the
962962
// field zero excluding subfields of collection and variant fields.
963963
if (c.IsDeferredColumn()) {
964-
columnRange.SetFirstElementIndex(fCluster.GetFirstEntryIndex() * nRepetitions);
965-
columnRange.SetNElements(fCluster.GetNEntries() * nRepetitions);
964+
if (c.GetRepresentationIndex() == 0) {
965+
columnRange.SetFirstElementIndex(fCluster.GetFirstEntryIndex() * nRepetitions);
966+
columnRange.SetNElements(fCluster.GetNEntries() * nRepetitions);
967+
} else {
968+
const auto &field = desc.GetFieldDescriptor(fieldId);
969+
const auto firstReprColumnId = field.GetLogicalColumnIds()[c.GetIndex()];
970+
const auto &firstReprColumnRange = fCluster.fColumnRanges[firstReprColumnId];
971+
columnRange.SetFirstElementIndex(firstReprColumnRange.GetFirstElementIndex());
972+
columnRange.SetNElements(firstReprColumnRange.GetNElements());
973+
}
966974
if (!columnRange.IsSuppressed()) {
967975
auto &pageRange = fCluster.fPageRanges[physicalId];
968976
pageRange.fPhysicalColumnId = physicalId;

0 commit comments

Comments
 (0)