diff --git a/tree/dataframe/inc/ROOT/RSqliteDS.hxx b/tree/dataframe/inc/ROOT/RSqliteDS.hxx new file mode 100644 index 0000000000000000000000000000000000000000..9bcc80891179bf8970b335d9c87ddafb6b50a4b9 --- /dev/null +++ b/tree/dataframe/inc/ROOT/RSqliteDS.hxx @@ -0,0 +1,46 @@ +// Author: Jakob Blomer CERN 07/2018 + +/************************************************************************* + * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_RSQLITEDS +#define ROOT_RSQLITEDS + +#include "ROOT/RDataFrame.hxx" +#include "ROOT/RDataSource.hxx" + +namespace ROOT { + +namespace RDF { + +class RSqliteDS final : public ROOT::RDF::RDataSource { +public: + RSqliteDS(std::string_view fileName, std::string_view query); + ~RSqliteDS(); + virtual void SetNSlots(unsigned int nSlots) override; + virtual const std::vector<std::string> &GetColumnNames() const override; + virtual bool HasColumn(std::string_view) const override; + virtual std::string GetTypeName(std::string_view) const override; + virtual std::vector<std::pair<ULong64_t, ULong64_t>> GetEntryRanges() override; + virtual bool SetEntry(unsigned int slot, ULong64_t entry) override; + +protected: + virtual Record_t GetColumnReadersImpl(std::string_view name, const std::type_info &) override; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////// +/// \brief Factory method to create a SQlite RDataFrame. +/// \param[in] fileName Path of the sqlite file. +/// \param[in] SQL query that defines the data set. +RDataFrame MakeSqliteDataFrame(std::string_view fileName, std::string_view query); + +} // ns RDF + +} // ns ROOT + +#endif diff --git a/tree/dataframe/src/RSqliteDS.cxx b/tree/dataframe/src/RSqliteDS.cxx new file mode 100644 index 0000000000000000000000000000000000000000..99220058d3b1489b04cf22f8ff402b11005a75b4 --- /dev/null +++ b/tree/dataframe/src/RSqliteDS.cxx @@ -0,0 +1,80 @@ +// Author: Jakob Blomer CERN 07/2018 + +/************************************************************************* + * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +// clang-format off +/** \class ROOT::RDF::RSqliteDS + \ingroup dataframe + \brief RDataFrame data source class for reading SQlite files. +*/ +// clang-format on + +#include <ROOT/RSqliteDS.hxx> +#include <ROOT/RDFUtils.hxx> +#include <ROOT/RMakeUnique.hxx> +#include <TError.h> + +namespace ROOT { + +namespace RDF { + +RSqliteDS::RSqliteDS(std::string_view fileName, std::string_view query) +{ +} + + +RSqliteDS::~RSqliteDS() +{ +} + + +const std::vector<std::string> &RSqliteDS::GetColumnNames() const +{ +} + + +RDataSource::Record_t RSqliteDS::GetColumnReadersImpl(std::string_view name, const std::type_info &) +{ +} + + +std::vector<std::pair<ULong64_t, ULong64_t>> RSqliteDS::GetEntryRanges() +{ +} + + +std::string RSqliteDS::GetTypeName(std::string_view) const +{ +} + + +bool RSqliteDS::HasColumn(std::string_view) const +{ +} + + +RDataFrame MakeSqliteDataFrame(std::string_view fileName, std::string_view query) +{ + ROOT::RDataFrame tdf(std::make_unique<RSqliteDS>(fileName, query)); + return tdf; +} + + +bool RSqliteDS::SetEntry(unsigned int slot, ULong64_t entry) +{ +} + + +void RSqliteDS::SetNSlots(unsigned int nSlots) +{ +} + +} // ns RDF + +} // ns ROOT