83 std::vector<unsigned char>
fBlob;
90 std::unique_ptr<Internal::RSqliteDSDataSet>
fDataSet;
103 "std::vector<unsigned char>",
109 RSqliteDS(
const std::string &fileName,
const std::string &query);
117 void SetNSlots(
unsigned int nSlots) final;
long long Long64_t
Portable signed long integer 8 bytes.
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
Pure virtual base class for all column reader types.
void * GetImpl(Long64_t) final
RSqliteDSColumnReader(void *valuePtr)
RDataSource defines an API that RDataFrame can use to read arbitrary data formats.
std::vector< void * > Record_t
void SetNSlots(unsigned int nSlots) final
Almost a no-op, many slots can in fact reduce the performance due to thread synchronization.
RSqliteDS & operator=(RSqliteDS &&)=delete
static constexpr char const * fgTypeNames[]
Corresponds to the types defined in ETypes.
std::string GetLabel() final
Return a string representation of the datasource type.
RSqliteDS & operator=(const RSqliteDS &)=delete
std::unique_ptr< ROOT::Detail::RDF::RColumnReaderBase > GetColumnReaders(unsigned int slot, std::string_view colName, const std::type_info &tid) final
If the other GetColumnReaders overload returns an empty vector, this overload will be called instead.
RSqliteDS(RSqliteDS &&)=delete
std::vector< std::string > fColumnNames
RSqliteDS(const RSqliteDS &)=delete
bool HasColumn(std::string_view colName) const final
A linear search through the columns for the given name.
void Initialize() final
Resets the SQlite query engine at the beginning of the event loop.
std::vector< ETypes > fColumnTypes
std::string GetTypeName(std::string_view colName) const final
Returns the C++ type for a given column name, implemented as a linear search through all the columns.
ETypes
All the types known to SQlite. Changes require changing fgTypeNames, too.
Record_t GetColumnReadersImpl(std::string_view name, const std::type_info &) final
Activates the given column's result value.
RSqliteDS(const std::string &fileName, const std::string &query)
Build the dataframe.
std::unique_ptr< Internal::RSqliteDSDataSet > fDataSet
std::vector< std::pair< ULong64_t, ULong64_t > > GetEntryRanges() final
Returns a range of size 1 as long as more rows are available in the SQL result set.
const std::vector< std::string > & GetColumnNames() const final
Returns the SELECT queries names.
bool SetEntry(unsigned int slot, ULong64_t entry) final
Stores the result of the current active sqlite query row as a C++ value.
~RSqliteDS() final
Frees the sqlite resources and closes the file.
void SqliteError(int errcode)
Helper function to throw an exception if there is a fatal sqlite error, e.g. an I/O error.
std::vector< Value_t > fValues
The data source is inherently single-threaded and returns only one row at a time. This vector holds t...
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
Special implementation of ROOT::RRangeCast for TCollection, including a check that the cast target ty...
RDataFrame FromSqlite(std::string_view fileName, std::string_view query)
Factory method to create a SQlite RDataFrame.
The state of an open dataset in terms of the sqlite3 C library.
void * fPtr
Points to one of the values; an address to this pointer is returned by GetColumnReadersImpl.
std::vector< unsigned char > fBlob
bool fIsActive
Not all columns of the query are necessarily used by the RDF. Allows for skipping them.