diff --git a/CMakeLists.txt b/CMakeLists.txt index 8de3988b4..ec780882a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -507,6 +507,7 @@ if(ENABLE_CONAN) OPTIONS boost:filesystem_version=3 # https://stackoverflow.com/questions/73392648/error-with-boost-filesystem-version-in-cmake onetbb:shared=${TBB_SHARED} boost:without_stacktrace=True # Apple Silicon cross-compilation fails without it + arrow:parquet=True BUILD missing ) # explicitly say Conan to use x86 dependencies if build for x86 platforms (https://github.com/conan-io/cmake-conan/issues/141) @@ -524,6 +525,8 @@ if(ENABLE_CONAN) add_dependency_includes(${CONAN_INCLUDE_DIRS_EXPAT}) add_dependency_includes(${CONAN_INCLUDE_DIRS_LUA}) add_dependency_includes(${CONAN_INCLUDE_DIRS_TBB}) + add_dependency_includes(${CONAN_INCLUDE_DIRS_ARROW}) + # message(FATAL_ERROR "SDSDF ${CONAN_INCLUDE_DIRS_ARROW}") set(Boost_USE_STATIC_LIBS ON) find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) @@ -545,6 +548,9 @@ if(ENABLE_CONAN) set(LUA_LIBRARIES ${lua_LIBRARIES}) find_package(TBB REQUIRED) + #find_package(Parquet REQUIRED) + find_package(Arrow REQUIRED) + set(ARROW_LIBRARIES ${arrow_LIBRARIES}) # note: we avoid calling find_package(Osmium ...) here to ensure that the @@ -678,7 +684,9 @@ set(UPDATER_LIBRARIES ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES} - ${ZLIB_LIBRARY}) + ${ZLIB_LIBRARY} + ${ARROW_LIBRARIES} + ) set(CONTRACTOR_LIBRARIES ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} diff --git a/include/updater/csv_file_parser.hpp b/include/updater/csv_file_parser.hpp index c9841798e..a0c987d93 100644 --- a/include/updater/csv_file_parser.hpp +++ b/include/updater/csv_file_parser.hpp @@ -1,5 +1,8 @@ #ifndef OSRM_UPDATER_CSV_FILE_PARSER_HPP #define OSRM_UPDATER_CSV_FILE_PARSER_HPP +#include +#include +#include #include "updater/source.hpp" @@ -44,6 +47,16 @@ template struct CSVFilesParser // Operator returns a lambda function that maps input Key to boost::optional. auto operator()(const std::vector &csv_filenames) const { + +std::shared_ptr infile; + + PARQUET_ASSIGN_OR_THROW( + infile, + arrow::io::ReadableFile::Open("test.parquet")); + + parquet::StreamReader os{parquet::ParquetFileReader::Open(infile)}; + (void)os; + try { tbb::spin_mutex mutex;