File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -547,6 +547,10 @@ public:
547547 void
548548 AddColumnRepresentation (const ROOT ::RFieldDescriptor &field, std::span<const ENTupleColumnType> newRepresentation);
549549
550+ // / Adds a new alias column pointing to an existing column with the given physical id to the given field.
551+ void AddAliasColumn (const ROOT ::RNTupleDescriptor &desc, const ROOT ::RFieldDescriptor &field,
552+ ROOT ::DescriptorId_t physicalId);
553+
550554 void CommitSuppressedColumn (ColumnHandle_t columnHandle) final ;
551555 void CommitPage (ColumnHandle_t columnHandle, const ROOT ::Internal::RPage &page) final ;
552556 void CommitSealedPage (ROOT ::DescriptorId_t physicalColumnId, const RPageStorage::RSealedPage &sealedPage) final ;
Original file line number Diff line number Diff line change @@ -1114,6 +1114,27 @@ void ROOT::Internal::RPagePersistentSink::AddColumnRepresentation(const ROOT::RF
11141114 }
11151115}
11161116
1117+ void ROOT::Internal::RPagePersistentSink::AddAliasColumn (const ROOT ::RNTupleDescriptor &desc,
1118+ const ROOT ::RFieldDescriptor &field,
1119+ ROOT ::DescriptorId_t physicalId)
1120+ {
1121+ const auto &pointedColumn = desc.GetColumnDescriptor (physicalId);
1122+ assert (!pointedColumn.IsAliasColumn ());
1123+
1124+ const auto columnId = fDescriptorBuilder .GetDescriptor ().GetNLogicalColumns ();
1125+ RColumnDescriptorBuilder columnBuilder;
1126+ columnBuilder.LogicalColumnId (columnId)
1127+ .PhysicalColumnId (physicalId)
1128+ .FieldId (field.GetId ())
1129+ .Type (pointedColumn.GetType ())
1130+ .Index (pointedColumn.GetIndex ())
1131+ .BitsOnStorage (pointedColumn.GetBitsOnStorage ())
1132+ .ValueRange (pointedColumn.GetValueRange ())
1133+ .FirstElementIndex (pointedColumn.GetFirstElementIndex ())
1134+ .RepresentationIndex (pointedColumn.GetRepresentationIndex ());
1135+ fDescriptorBuilder .AddColumn (columnBuilder.MakeDescriptor ().Unwrap ());
1136+ }
1137+
11171138void ROOT::Internal::RPagePersistentSink::CommitSuppressedColumn (ColumnHandle_t columnHandle)
11181139{
11191140 fOpenColumnRanges .at (columnHandle.fPhysicalId ).SetIsSuppressed (true );
You can’t perform that action at this time.
0 commit comments