Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Framework/Core/include/Framework/AnalysisHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
#include "Framework/Traits.h"

#include <string>
namespace o2::framework {
namespace o2::framework
{
std::string serializeProjectors(std::vector<framework::expressions::Projector>& projectors);
std::string serializeSchema(std::shared_ptr<arrow::Schema>& schema);
}
} // namespace o2::framework

namespace o2::soa
{
Expand Down
2 changes: 1 addition & 1 deletion Framework/Core/src/AODReaderHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ struct Spawnable {

Spawnable(InputSpec const& spec)
{
auto loc = std::find_if(spec.metadata.begin(), spec.metadata.end(), [](ConfigParamSpec const& spc){ return spc.name.compare("projectors") == 0; });
auto loc = std::find_if(spec.metadata.begin(), spec.metadata.end(), [](ConfigParamSpec const& spc) { return spc.name.compare("projectors") == 0; });
std::stringstream iws(loc->defaultValue.get<std::string>());
projectors = ExpressionJSONHelpers::read(iws);
for (auto& i : spec.metadata) {
Expand Down
18 changes: 10 additions & 8 deletions Framework/Core/src/ExpressionJSONHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,8 @@ void o2::framework::ExpressionJSONHelpers::write(std::ostream& o, std::vector<o2
w.EndObject();
}

namespace {
namespace
{
struct SchemaReader : public rapidjson::BaseReaderHandler<rapidjson::UTF8<>, SchemaReader> {
using Ch = rapidjson::UTF8<>::Ch;
using SizeType = rapidjson::SizeType;
Expand Down Expand Up @@ -679,7 +680,7 @@ struct SchemaReader : public rapidjson::BaseReaderHandler<rapidjson::UTF8<>, Sch
{
debug << "Ending array" << std::endl;
if (states.top() == State::IN_LIST) {
//finalize schema
// finalize schema
schema = std::make_shared<arrow::Schema>(fields);
states.pop();
return true;
Expand Down Expand Up @@ -773,13 +774,13 @@ struct SchemaReader : public rapidjson::BaseReaderHandler<rapidjson::UTF8<>, Sch
return false;
}

bool Int(int i) {
bool Int(int i)
{
debug << "Int(" << i << ")" << std::endl;
return Uint(i);
}

};
}
} // namespace

std::shared_ptr<arrow::Schema> o2::framework::ArrowJSONHelpers::read(std::istream& s)
{
Expand All @@ -789,13 +790,14 @@ std::shared_ptr<arrow::Schema> o2::framework::ArrowJSONHelpers::read(std::istrea

bool ok = reader.Parse(isw, sreader);

if(!ok) {
if (!ok) {
throw framework::runtime_error_f("Cannot parse serialized Expression, error: %s at offset: %d", rapidjson::GetParseError_En(reader.GetParseErrorCode()), reader.GetErrorOffset());
}
return sreader.schema;
}

namespace {
namespace
{
void writeSchema(rapidjson::Writer<rapidjson::OStreamWrapper>& w, arrow::Schema* schema)
{
for (auto& f : schema->fields()) {
Expand All @@ -807,7 +809,7 @@ void writeSchema(rapidjson::Writer<rapidjson::OStreamWrapper>& w, arrow::Schema*
w.EndObject();
}
}
}
} // namespace

void o2::framework::ArrowJSONHelpers::write(std::ostream& o, std::shared_ptr<arrow::Schema>& schema)
{
Expand Down