11#include <OpenMS/config.h>
19#include <unordered_set>
26 class KeyValueMetadata;
32class MetaInfoInterface;
43namespace ArrowIOHelpers
63 const std::shared_ptr<arrow::Table>& table,
64 const std::string& filename,
83 const std::vector<std::shared_ptr<arrow::Table>>& tables,
84 const std::string& filename,
86 const std::shared_ptr<const arrow::KeyValueMetadata>& metadata =
nullptr);
110 const std::string& file_type,
112 const std::map<std::string, std::string>& extra = {});
132 OPENMS_DLLAPI std::string
qpxScanFormat(
const std::vector<std::string>& native_ids);
160 const std::string& context,
161 const std::vector<std::string>& ms_run_paths);
185 const std::string& column_label,
186 const std::string& channel_name);
199 const std::shared_ptr<arrow::Table>& table,
200 const std::string& name,
201 bool required =
true);
205 const std::shared_ptr<arrow::Array>& array,
210 const std::shared_ptr<arrow::Array>& array,
212 double default_val = 0.0);
216 const std::shared_ptr<arrow::Array>& array,
218 float default_val = 0.0f);
222 const std::shared_ptr<arrow::Array>& array,
224 int32_t default_val = 0);
228 const std::shared_ptr<arrow::Array>& array,
230 int64_t default_val = 0);
234 const std::shared_ptr<arrow::Array>& array,
236 bool default_val =
false);
240 const std::shared_ptr<arrow::Array>& array,
250 const std::shared_ptr<arrow::Array>& array,
253 const std::unordered_set<std::string>& excluded_keys = {});
int32_t getInt32Value(const std::shared_ptr< arrow::Array > &array, int64_t row, int32_t default_val=0)
Read an int32 at row, or default_val if null.
bool writeTableToParquet(const std::shared_ptr< arrow::Table > &table, const std::string &filename, const ParquetWriteConfig &config=ParquetWriteConfig{})
Write an Arrow table to a Parquet file.
int64_t getInt64Value(const std::shared_ptr< arrow::Array > &array, int64_t row, int64_t default_val=0)
Read an int64 at row, or default_val if null.
bool getBoolValue(const std::shared_ptr< arrow::Array > &array, int64_t row, bool default_val=false)
Read a bool at row, or default_val if null.
float getFloatValue(const std::shared_ptr< arrow::Array > &array, int64_t row, float default_val=0.0f)
Read a float at row, or default_val if null.
double getDoubleValue(const std::shared_ptr< arrow::Array > &array, int64_t row, double default_val=0.0)
Read a double at row, or default_val if null.
std::string generateUuidV4()
Generate a lowercase hyphenated RFC 4122 version-4 UUID string.
void readMetaValues(const std::shared_ptr< arrow::Array > &array, int64_t row, MetaInfoInterface &target, const std::unordered_set< std::string > &excluded_keys={})
Read metavalues from a list<struct{name,value,value_type}> column.
std::shared_ptr< arrow::Array > getColumn(const std::shared_ptr< arrow::Table > &table, const std::string &name, bool required=true)
Fetch a named column from a table, combining chunks if needed.
std::string qpxIntensityLabel(const std::string &column_label, const std::string &channel_name)
QPX intensities[].label for a ConsensusMap column header.
std::string qpxRunFileName(const std::string &ms_run_path)
Reduce an MS run path to the QPX run_file_name form.
std::string getStringValue(const std::shared_ptr< arrow::Array > &array, int64_t row)
Read a string at row, or "" if null/out-of-bounds.
std::string qpxScanFormat(const std::string &native_id)
Classify a spectrum native ID into a QPX scan_format token.
bool concatenateAndWriteToParquet(const std::vector< std::shared_ptr< arrow::Table > > &tables, const std::string &filename, const ParquetWriteConfig &config=ParquetWriteConfig{}, const std::shared_ptr< const arrow::KeyValueMetadata > &metadata=nullptr)
Concatenate a vector of Arrow tables and write the result to a Parquet file.
std::shared_ptr< const arrow::KeyValueMetadata > qpxFileMetadata(const std::string &file_type, const ParquetWriteConfig &config=ParquetWriteConfig{}, const std::map< std::string, std::string > &extra={})
Build the canonical QPX file-level key-value metadata.
bool qpxWarnOnRunNameCollisions(const std::string &context, const std::vector< std::string > &ms_run_paths)
Warn once per export about source files that collapse onto one run_file_name.
bool isNull(const std::shared_ptr< arrow::Array > &array, int64_t row)
Whether array is null at row (or unset)
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition ArrowIOHelpers.h:24
Configuration for Parquet file writing.
Definition MSExperimentArrowExport.h:136