11#include <OpenMS/config.h>
15#include <arrow/io/interfaces.h>
58 static void appendOrThrow(
const arrow::Status& status,
const std::string& column);
70 template <
typename BuilderT>
71 static std::shared_ptr<arrow::Array>
finishArray(BuilderT& builder,
const std::string& name)
73 std::shared_ptr<arrow::Array> array;
74 auto status = builder.Finish(&array);
77 throw_finish_error_(name, status.ToString());
98 static void writeTable(
const std::shared_ptr<arrow::Table>& table,
const std::string& filename,
99 int64_t row_group_size = 262144);
112 static std::shared_ptr<arrow::Table>
readTable(
const std::string& filename);
118 static std::shared_ptr<arrow::Table>
readTable(
const std::shared_ptr<arrow::io::RandomAccessFile>& infile);
137 static std::shared_ptr<arrow::Array>
getColumn(
const std::shared_ptr<arrow::Table>& table,
138 const std::string& name);
150 static std::shared_ptr<arrow::Array>
getOptionalColumn(
const std::shared_ptr<arrow::Table>& table,
151 const std::string& name);
174 static int64_t
getInt64(
const std::shared_ptr<arrow::Array>& array, int64_t row,
175 int64_t default_value,
bool allow_null);
192 static double getDouble(
const std::shared_ptr<arrow::Array>& array, int64_t row,
193 double default_value,
bool allow_null);
210 static bool getBool(
const std::shared_ptr<arrow::Array>& array, int64_t row,
211 bool default_value,
bool allow_null);
225 static std::string
getString(
const std::shared_ptr<arrow::Array>& array, int64_t row);
239 static std::vector<std::string>
getStringList(
const std::shared_ptr<arrow::Array>& array, int64_t row);
260 static int64_t
rowCount(
const std::string& filename);
Shared utilities for reading, writing, and packaging Parquet-based file formats.
Definition ParquetFile.h:44
static void throw_finish_error_(const std::string &name, const std::string &error)
Internal helper to throw a consistent error from finishArray.
static std::shared_ptr< arrow::Array > finishArray(BuilderT &builder, const std::string &name)
Finish an Arrow builder and return the resulting Array.
Definition ParquetFile.h:71
static void appendOrThrow(const arrow::Status &status, const std::string &column)
Append a value to an Arrow builder, throwing on failure.
static std::vector< std::string > getStringList(const std::shared_ptr< arrow::Array > &array, int64_t row)
Read a list of strings from an Arrow Array.
static int64_t getInt64(const std::shared_ptr< arrow::Array > &array, int64_t row, int64_t default_value, bool allow_null)
Read an integer value from an Arrow Array with type coercion.
static double getDouble(const std::shared_ptr< arrow::Array > &array, int64_t row, double default_value, bool allow_null)
Read a floating-point value from an Arrow Array with type coercion.
static std::string jsonEscape(const std::string &input)
Escape a string for safe embedding into JSON values.
static std::string getString(const std::shared_ptr< arrow::Array > &array, int64_t row)
Read a string value from an Arrow Array.
static std::shared_ptr< arrow::Table > readTable(const std::string &filename)
Read a Parquet file into an Arrow Table.
static std::shared_ptr< arrow::Array > getOptionalColumn(const std::shared_ptr< arrow::Table > &table, const std::string &name)
Get an optional column from an Arrow Table by name.
static bool getBool(const std::shared_ptr< arrow::Array > &array, int64_t row, bool default_value, bool allow_null)
Read a boolean value from an Arrow Array with type coercion.
static int64_t rowCount(const std::string &filename)
Return the number of rows in a parquet file using the low-level parquet reader metadata....
static void writeTable(const std::shared_ptr< arrow::Table > &table, const std::string &filename, int64_t row_group_size=262144)
Write an Arrow Table to a Parquet file.
static std::shared_ptr< arrow::Array > getColumn(const std::shared_ptr< arrow::Table > &table, const std::string &name)
Get a required column from an Arrow Table by name.
static std::shared_ptr< arrow::Table > readTable(const std::shared_ptr< arrow::io::RandomAccessFile > &infile)
Read a Parquet file from an Arrow RandomAccessFile into an Arrow Table.
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19