From b279524d209fbb9367b3bb56bc3459fec0706964 Mon Sep 17 00:00:00 2001 From: Jack Del Vecchio Date: Wed, 31 Jan 2024 18:11:17 +0000 Subject: [PATCH] Fix windows linker issues. Install parquetembed in Lib directory for linking with thorhelper.dll Fix warnings related to control paths not returning a value. --- plugins/parquet/CMakeLists.txt | 46 +++----------------------------- plugins/parquet/parquetembed.cpp | 7 ++++- plugins/parquet/parquetembed.hpp | 8 +++--- 3 files changed, 14 insertions(+), 47 deletions(-) diff --git a/plugins/parquet/CMakeLists.txt b/plugins/parquet/CMakeLists.txt index 7f7088f71aa..f0330ec1478 100644 --- a/plugins/parquet/CMakeLists.txt +++ b/plugins/parquet/CMakeLists.txt @@ -59,48 +59,10 @@ if(PARQUETEMBED OR USE_PARQUET) ) install( - FILES ${LIBARROW_LIB_REAL} - DESTINATION ${LIB_DIR} CALC_DEPS - PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - COMPONENT Runtime) - - install( - FILES ${LIBARROW_LIB} ${LIBARROW_LIB_ABI} - DESTINATION ${LIB_DIR} CALC_DEPS - COMPONENT Runtime) - - install( - FILES ${LIBPARQUET_LIB_REAL} - DESTINATION ${LIB_DIR} CALC_DEPS - PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - COMPONENT Runtime) - - install( - FILES ${LIBPARQUET_LIB} ${LIBPARQUET_LIB_ABI} - DESTINATION ${LIB_DIR} CALC_DEPS - COMPONENT Runtime) - - install( - FILES ${LIBARRORACERO_LIB_REAL} - DESTINATION ${LIB_DIR} CALC_DEPS - PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - COMPONENT Runtime) - - install( - FILES ${LIBARRORACERO_LIB} ${LIBARROWDATASET_LIB_ABI} - DESTINATION ${LIB_DIR} CALC_DEPS - COMPONENT Runtime) - - install( - FILES ${LIBARROWDATASET_LIB_REAL} - DESTINATION ${LIB_DIR} CALC_DEPS - PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - COMPONENT Runtime) - - install( - FILES ${LIBARROWDATASET_LIB} ${LIBARROWDATASET_LIB_ABI} - DESTINATION ${LIB_DIR} CALC_DEPS - COMPONENT Runtime) + TARGETS parquetembed + DESTINATION ${LIB_DIR} + COMPONENT Runtime CALC_DEPS + ) target_link_libraries( parquetembed diff --git a/plugins/parquet/parquetembed.cpp b/plugins/parquet/parquetembed.cpp index 4ebe9760bbc..f368fb7bc5e 100644 --- a/plugins/parquet/parquetembed.cpp +++ b/plugins/parquet/parquetembed.cpp @@ -31,7 +31,7 @@ static const NullFieldProcessor NULLFIELD(NULL); * @brief Takes a pointer to an ECLPluginDefinitionBlock and passes in all the important info * about the plugin. */ -extern "C" PARQUETEMBED_PLUGIN_API bool getECLPluginDefinition(ECLPluginDefinitionBlock *pb) +extern "C" DECL_EXPORT bool getECLPluginDefinition(ECLPluginDefinitionBlock *pb) { if (pb->size == sizeof(ECLPluginDefinitionBlockEx)) { @@ -298,6 +298,7 @@ std::shared_ptr ParquetReader::queryCurrentTable offset = tables; } failx("Failed getting RowGroupReader. Index %lli is out of bounds.", currTable); + return nullptr; } /** @@ -981,6 +982,7 @@ __int64 getSigned(std::shared_ptr &arrayVisitor, int index) default: failx("getSigned: Invalid size %i", arrayVisitor->size); } + return 0; } /** @@ -1005,6 +1007,7 @@ unsigned __int64 getUnsigned(std::shared_ptr &arrayVisitor, default: failx("getUnsigned: Invalid size %i", arrayVisitor->size); } + return 0; } /** @@ -1027,6 +1030,7 @@ double getReal(std::shared_ptr &arrayVisitor, int index) default: failx("getReal: Invalid size %i", arrayVisitor->size); } + return 0; } /** @@ -1078,6 +1082,7 @@ std::string_view ParquetRowBuilder::getCurrView(const RtlFieldInfo *field) default: failx("Unimplemented Parquet type for field with name %s.", field->name); } + return ""; } /** diff --git a/plugins/parquet/parquetembed.hpp b/plugins/parquet/parquetembed.hpp index b9db5085c82..1bce7db6ac6 100644 --- a/plugins/parquet/parquetembed.hpp +++ b/plugins/parquet/parquetembed.hpp @@ -787,7 +787,7 @@ using TableColumns = std::unordered_map rbatchReader = nullptr; // RecordBatchReader reads a dataset one record batch at a time. Must be kept alive for rbatchItr. arrow::RecordBatchReader::RecordBatchReaderIterator rbatchItr; // Iterator of RecordBatches when reading a partitioned dataset. std::vector<__int64> fileTableCounts; // Count of RowGroups in each open file to get the correct row group when reading specific parts of the file. - std::vector> parquetFileReaders; // Vector of FileReaders that match the target file name. data0.parquet, data1.parquet, etc. + std::vector> parquetFileReaders; // Vector of FileReaders that match the target file name. data0.parquet, data1.parquet, etc. TableColumns parquetTable; // The current table being read broken up into columns. Unordered map where the left side is a string of the field name and the right side is an array of the values. std::vector partitionFields; // The partitioning schema for reading Directory Partitioned files. arrow::MemoryPool *pool = nullptr; // Memory pool for reading parquet files. @@ -829,7 +829,7 @@ class ParquetReader * target directory or matching the file mask will be deleted and writing will continue. openWriteFile opens the write file or sets the * partitioning options. writeRecordBatch utilizes the open write streams and writes the data to the target location. */ -class ParquetWriter +class PARQUETEMBED_PLUGIN_API ParquetWriter { public: ParquetWriter(const char *option, const char *_destination, int _maxRowCountInBatch, bool _overwrite, arrow::Compression::type _compressionOption, const char *_partitionFields, const IThorActivityContext *_activityCtx); @@ -896,7 +896,7 @@ class ParquetRowStream : public RtlCInterface, implements IRowStream * @brief Builds ECL records for ParquetRowStream. * */ -class ParquetRowBuilder : public CInterfaceOf +class PARQUETEMBED_PLUGIN_API ParquetRowBuilder : public CInterfaceOf { public: ParquetRowBuilder(TableColumns *_resultRows, int64_t _currentRow)