52 Error(
"RNTuple::Merge",
"Output file already has key, but not of type RNTuple!");
67 auto desc =
source->GetSharedDescriptorGuard();
72 std::vector<std::unique_ptr<Internal::RPageSourceFile>>
sources;
73 std::vector<Internal::RPageSource *>
sourcePtrs;
75 while (
const auto &
pitr =
itr()) {
101 std::vector<ROOT::Experimental::Internal::RNTupleMerger::RColumnInfo> &
columns)
104 column.fColumnOutputId = fOutputIdMap.size();
105 fOutputIdMap[column.fColumnName +
"." + column.fColumnTypeAndVersion] = column.fColumnOutputId;
111 std::vector<ROOT::Experimental::Internal::RNTupleMerger::RColumnInfo> &
columns)
114 if (fOutputIdMap.size() !=
columns.size()) {
120 column.fColumnOutputId = fOutputIdMap.at(column.fColumnName +
"." + column.fColumnTypeAndVersion);
121 }
catch (
const std::out_of_range &) {
122 throw RException(
R__FAIL(
"Column NOT found in the first source w/ name " + column.fColumnName +
123 " type and version " + column.fColumnTypeAndVersion));
129std::vector<ROOT::Experimental::Internal::RNTupleMerger::RColumnInfo>
132 std::vector<RColumnInfo>
columns;
137 if (fOutputIdMap.empty()) {
151 std::string
name = prefix +
field.GetFieldName() +
".";
173 if (
source->GetNEntries() == 0) {
198 std::vector<std::unique_ptr<unsigned char[]>>
buffers;
201 std::deque<RPageStorage::SealedPageSequence_t>
sealedPagesV;
204 for (
const auto &column :
columns) {
208 auto columnId = column.fColumnInputId;
231 auto buffer = std::make_unique<unsigned char[]>(
sealedPage.fSize);
235 buffers.push_back(std::move(buffer));
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Given a set of RPageSources merge them into an RPageSink.
void AddColumnsFromField(std::vector< RColumnInfo > &columns, const RNTupleDescriptor &desc, const RFieldDescriptor &fieldDesc, const std::string &prefix="")
Recursively add columns from a given field.
void Merge(std::span< RPageSource * > sources, RPageSink &destination)
Merge a given set of sources into the destination.
std::vector< RColumnInfo > CollectColumns(const RNTupleDescriptor &descriptor)
Recursively collect all the columns for all the fields rooted at field zero.
void BuildColumnIdMap(std::vector< RColumnInfo > &columns)
Build the internal column id map from the first source This is where we assign the output ids for the...
void ValidateColumns(std::vector< RColumnInfo > &columns)
Validate the columns against the internal map that is built from the first source This is where we as...
Abstract interface to write data into an ntuple.
static std::unique_ptr< RPageSourceFile > CreateFromAnchor(const RNTuple &anchor, const RNTupleReadOptions &options=RNTupleReadOptions())
Used from the RNTuple class to build a datasource if the anchor is already available.
std::deque< RSealedPage > SealedPageSequence_t
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
Base class for all ROOT issued exceptions.
Meta-data stored for every field of an ntuple.
The on-storage meta-data of an ntuple.
RFieldDescriptorIterable GetFieldIterable(const RFieldDescriptor &fieldDesc) const
RColumnDescriptorIterable GetColumnIterable() const
Common user-tunable settings for storing ntuples.
Representation of an RNTuple data set in a ROOT file.
Long64_t Merge(TCollection *input, TFileMergeInfo *mergeInfo)
RNTuple implements the hadd MergeFile interface Merge this NTuple with the input list entries.
Collection abstract base class.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Book space in a file, create I/O buffers, to fill them, (un)compress them.
constexpr DescriptorId_t kInvalidDescriptorId
A sealed page contains the bytes of a page as written to storage (packed & compressed).