Skip to content

Commit

Permalink
Fix windows linker issues.
Browse files Browse the repository at this point in the history
Install parquetembed in Lib directory for linking with thorhelper.dll
Fix warnings related to control paths not returning a value.
  • Loading branch information
jackdelv committed Jan 31, 2024
1 parent 128f37f commit b279524
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 47 deletions.
46 changes: 4 additions & 42 deletions plugins/parquet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion plugins/parquet/parquetembed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -298,6 +298,7 @@ std::shared_ptr<parquet::arrow::RowGroupReader> ParquetReader::queryCurrentTable
offset = tables;
}
failx("Failed getting RowGroupReader. Index %lli is out of bounds.", currTable);
return nullptr;
}

/**
Expand Down Expand Up @@ -981,6 +982,7 @@ __int64 getSigned(std::shared_ptr<ParquetArrayVisitor> &arrayVisitor, int index)
default:
failx("getSigned: Invalid size %i", arrayVisitor->size);
}
return 0;
}

/**
Expand All @@ -1005,6 +1007,7 @@ unsigned __int64 getUnsigned(std::shared_ptr<ParquetArrayVisitor> &arrayVisitor,
default:
failx("getUnsigned: Invalid size %i", arrayVisitor->size);
}
return 0;
}

/**
Expand All @@ -1027,6 +1030,7 @@ double getReal(std::shared_ptr<ParquetArrayVisitor> &arrayVisitor, int index)
default:
failx("getReal: Invalid size %i", arrayVisitor->size);
}
return 0;
}

/**
Expand Down Expand Up @@ -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 "";
}

/**
Expand Down
8 changes: 4 additions & 4 deletions plugins/parquet/parquetembed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ using TableColumns = std::unordered_map<std::string, std::shared_ptr<arrow::Arra
* The next function returns the index to read and the table to read from. shouldRead will return true as long as
* the worker can read another row.
*/
class ParquetReader
class PARQUETEMBED_PLUGIN_API ParquetReader
{
public:
ParquetReader(const char *option, const char *_location, int _maxRowCountInTable, const char *_partitionFields, const IThorActivityContext *_activityCtx);
Expand Down Expand Up @@ -817,7 +817,7 @@ class ParquetReader
std::shared_ptr<arrow::RecordBatchReader> 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<std::unique_ptr<parquet::arrow::FileReader>> parquetFileReaders; // Vector of FileReaders that match the target file name. data0.parquet, data1.parquet, etc.
std::vector<std::shared_ptr<parquet::arrow::FileReader>> 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<std::string> partitionFields; // The partitioning schema for reading Directory Partitioned files.
arrow::MemoryPool *pool = nullptr; // Memory pool for reading parquet files.
Expand All @@ -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);
Expand Down Expand Up @@ -896,7 +896,7 @@ class ParquetRowStream : public RtlCInterface, implements IRowStream
* @brief Builds ECL records for ParquetRowStream.
*
*/
class ParquetRowBuilder : public CInterfaceOf<IFieldSource>
class PARQUETEMBED_PLUGIN_API ParquetRowBuilder : public CInterfaceOf<IFieldSource>
{
public:
ParquetRowBuilder(TableColumns *_resultRows, int64_t _currentRow)
Expand Down

0 comments on commit b279524

Please sign in to comment.