19 #include <arrow/api.h>
20 #include <arrow/filesystem/filesystem.h>
21 #include <arrow/io/api.h>
22 #include <parquet/arrow/reader.h>
23 #include <parquet/statistics.h>
24 #include <parquet/types.h>
30 namespace foreign_storage {
47 std::shared_ptr<arrow::fs::FileSystem>& file_system);
52 const parquet::arrow::FileReader* reader,
53 const int logical_column_index);
56 const parquet::ColumnDescriptor* reference_descriptor,
57 const parquet::ColumnDescriptor* new_descriptor,
58 const std::string& reference_file_path,
59 const std::string& new_file_path);
65 const parquet::ColumnChunkMetaData* column_metadata);
71 std::shared_ptr<arrow::fs::FileSystem>& file_system) {
73 if (
map_.count(path) < 1 || !(
map_.at(path))) {
76 return map_.at(path).get();
80 std::shared_ptr<arrow::fs::FileSystem>& file_system) {
83 return map_.at(path).get();
88 if (
map_.count(path) < 1) {
100 std::map<const std::string, UniqueReaderPtr>
map_;
std::shared_ptr< parquet::Statistics > validate_and_get_column_metadata_statistics(const parquet::ColumnChunkMetaData *column_metadata)
std::pair< int, int > get_parquet_table_size(const ReaderPtr &reader)
std::unique_ptr< ColumnDescriptor > get_sub_type_column_descriptor(const ColumnDescriptor *column)
void validate_equal_column_descriptor(const parquet::ColumnDescriptor *reference_descriptor, const parquet::ColumnDescriptor *new_descriptor, const std::string &reference_file_path, const std::string &new_file_path)
UniqueReaderPtr open_parquet_table(const std::string &file_path, std::shared_ptr< arrow::fs::FileSystem > &file_system)
const parquet::ColumnDescriptor * get_column_descriptor(const parquet::arrow::FileReader *reader, const int logical_column_index)
const ReaderPtr getOrInsert(const std::string &path, std::shared_ptr< arrow::fs::FileSystem > &file_system)
std::unique_lock< T > unique_lock
specifies the content in-memory of a row in the column metadata table
parquet::arrow::FileReader * ReaderPtr
const ReaderPtr insert(const std::string &path, std::shared_ptr< arrow::fs::FileSystem > &file_system)
void initializeIfEmpty(const std::string &path)
std::map< const std::string, UniqueReaderPtr > map_
std::unique_ptr< parquet::arrow::FileReader > UniqueReaderPtr