From 85c1f1b6ed70c757bfe3f38a0f55043e9fd59897 Mon Sep 17 00:00:00 2001 From: Zehua Zou Date: Sun, 23 Nov 2025 23:15:02 +0800 Subject: [PATCH] fix: add missing export --- src/iceberg/arrow_c_data_guard_internal.h | 10 +++++----- src/iceberg/avro/avro_data_util_internal.h | 16 +++++++++------- src/iceberg/avro/avro_schema_util_internal.h | 18 ++++++++++-------- src/iceberg/avro/avro_stream_internal.h | 6 ++++-- src/iceberg/file_reader.h | 2 +- src/iceberg/file_writer.h | 2 +- .../parquet/parquet_data_util_internal.h | 3 ++- .../parquet/parquet_schema_util_internal.h | 11 +++++++---- src/iceberg/schema_internal.h | 4 ++-- src/iceberg/util/gzip_internal.h | 3 ++- src/iceberg/v1_metadata.h | 5 +++-- src/iceberg/v2_metadata.h | 5 +++-- src/iceberg/v3_metadata.h | 5 +++-- 13 files changed, 52 insertions(+), 38 deletions(-) diff --git a/src/iceberg/arrow_c_data_guard_internal.h b/src/iceberg/arrow_c_data_guard_internal.h index 8bce14e57..6b6f1c324 100644 --- a/src/iceberg/arrow_c_data_guard_internal.h +++ b/src/iceberg/arrow_c_data_guard_internal.h @@ -21,11 +21,11 @@ #include -#include "iceberg/arrow_c_data.h" +#include "iceberg/iceberg_export.h" namespace iceberg::internal { -class ArrowArrayGuard { +class ICEBERG_EXPORT ArrowArrayGuard { public: explicit ArrowArrayGuard(ArrowArray* array) : array_(array) {} ~ArrowArrayGuard(); @@ -34,7 +34,7 @@ class ArrowArrayGuard { ArrowArray* array_; }; -class ArrowSchemaGuard { +class ICEBERG_EXPORT ArrowSchemaGuard { public: explicit ArrowSchemaGuard(ArrowSchema* schema) : schema_(schema) {} ~ArrowSchemaGuard(); @@ -43,7 +43,7 @@ class ArrowSchemaGuard { ArrowSchema* schema_; }; -class ArrowArrayViewGuard { +class ICEBERG_EXPORT ArrowArrayViewGuard { public: explicit ArrowArrayViewGuard(ArrowArrayView* view) : view_(view) {} ~ArrowArrayViewGuard(); @@ -52,7 +52,7 @@ class ArrowArrayViewGuard { ArrowArrayView* view_; }; -class ArrowArrayBufferGuard { +class ICEBERG_EXPORT ArrowArrayBufferGuard { public: explicit ArrowArrayBufferGuard(ArrowBuffer* buffer) : buffer_(buffer) {} ~ArrowArrayBufferGuard(); diff --git a/src/iceberg/avro/avro_data_util_internal.h b/src/iceberg/avro/avro_data_util_internal.h index 0de383ed5..8c124f195 100644 --- a/src/iceberg/avro/avro_data_util_internal.h +++ b/src/iceberg/avro/avro_data_util_internal.h @@ -22,6 +22,7 @@ #include #include +#include "iceberg/iceberg_bundle_export.h" #include "iceberg/schema_util.h" namespace iceberg::avro { @@ -37,11 +38,11 @@ namespace iceberg::avro { /// \param projected_schema The projected schema /// \param array_builder The Arrow array builder to append to (must be a struct builder) /// \return Status indicating success or failure -Status AppendDatumToBuilder(const ::avro::NodePtr& avro_node, - const ::avro::GenericDatum& avro_datum, - const SchemaProjection& projection, - const Schema& projected_schema, - ::arrow::ArrayBuilder* array_builder); +ICEBERG_BUNDLE_EXPORT Status AppendDatumToBuilder(const ::avro::NodePtr& avro_node, + const ::avro::GenericDatum& avro_datum, + const SchemaProjection& projection, + const Schema& projected_schema, + ::arrow::ArrayBuilder* array_builder); /// \brief Extract an Avro datum from an Arrow array. /// @@ -49,7 +50,8 @@ Status AppendDatumToBuilder(const ::avro::NodePtr& avro_node, /// \param index The index of the element to extract. /// \param datum The Avro datum to extract to. Its Avro type should be consistent with the /// Arrow type. -Status ExtractDatumFromArray(const ::arrow::Array& array, int64_t index, - ::avro::GenericDatum* datum); +ICEBERG_BUNDLE_EXPORT Status ExtractDatumFromArray(const ::arrow::Array& array, + int64_t index, + ::avro::GenericDatum* datum); } // namespace iceberg::avro diff --git a/src/iceberg/avro/avro_schema_util_internal.h b/src/iceberg/avro/avro_schema_util_internal.h index bdfbf135a..b9cc32aff 100644 --- a/src/iceberg/avro/avro_schema_util_internal.h +++ b/src/iceberg/avro/avro_schema_util_internal.h @@ -23,6 +23,7 @@ #include +#include "iceberg/iceberg_bundle_export.h" #include "iceberg/name_mapping.h" #include "iceberg/result.h" #include "iceberg/schema_util.h" @@ -40,7 +41,7 @@ struct MapLogicalType : public ::avro::CustomLogicalType { }; /// \brief A visitor that converts an Iceberg type to an Avro node. -class ToAvroNodeVisitor { +class ICEBERG_BUNDLE_EXPORT ToAvroNodeVisitor { public: Status Visit(const BooleanType& type, ::avro::NodePtr* node); Status Visit(const IntType& type, ::avro::NodePtr* node); @@ -67,7 +68,7 @@ class ToAvroNodeVisitor { }; /// \brief A visitor that checks the presence of field IDs in an Avro schema. -class HasIdVisitor { +class ICEBERG_BUNDLE_EXPORT HasIdVisitor { public: HasIdVisitor() = default; @@ -137,8 +138,9 @@ class HasIdVisitor { /// \param avro_node The Avro node to read data from. /// \param prune_source Whether the source schema can be pruned. /// \return The schema projection result. -Result Project(const Schema& expected_schema, - const ::avro::NodePtr& avro_node, bool prune_source); +ICEBERG_BUNDLE_EXPORT Result Project(const Schema& expected_schema, + const ::avro::NodePtr& avro_node, + bool prune_source); std::string ToString(const ::avro::NodePtr& node); std::string ToString(const ::avro::LogicalType& logical_type); @@ -157,14 +159,14 @@ bool HasMapLogicalType(const ::avro::NodePtr& node); /// /// \param name The name to check. /// \return True if the name is valid, false otherwise. -bool ValidAvroName(std::string_view name); +ICEBERG_BUNDLE_EXPORT bool ValidAvroName(std::string_view name); /// \brief Create a new Avro node with field IDs from name mapping. /// \param original_node The original Avro node to copy. /// \param mapping The name mapping to apply field IDs from. /// \return A new Avro node with field IDs applied, or an error. -Result<::avro::NodePtr> MakeAvroNodeWithFieldIds(const ::avro::NodePtr& original_node, - const NameMapping& mapping); +ICEBERG_BUNDLE_EXPORT Result<::avro::NodePtr> MakeAvroNodeWithFieldIds( + const ::avro::NodePtr& original_node, const NameMapping& mapping); /// \brief Sanitize a field name to make it compatible with Avro field name requirements. /// @@ -187,6 +189,6 @@ Result<::avro::NodePtr> MakeAvroNodeWithFieldIds(const ::avro::NodePtr& original /// /// \param field_name The original field name to sanitize. /// \return A sanitized field name that follows Avro naming conventions. -std::string SanitizeFieldName(std::string_view field_name); +ICEBERG_BUNDLE_EXPORT std::string SanitizeFieldName(std::string_view field_name); } // namespace iceberg::avro diff --git a/src/iceberg/avro/avro_stream_internal.h b/src/iceberg/avro/avro_stream_internal.h index 18653cca6..66db2b6a2 100644 --- a/src/iceberg/avro/avro_stream_internal.h +++ b/src/iceberg/avro/avro_stream_internal.h @@ -22,9 +22,11 @@ #include #include +#include "iceberg/iceberg_bundle_export.h" + namespace iceberg::avro { -class AvroInputStream : public ::avro::SeekableInputStream { +class ICEBERG_BUNDLE_EXPORT AvroInputStream : public ::avro::SeekableInputStream { public: explicit AvroInputStream(std::shared_ptr<::arrow::io::RandomAccessFile> input_stream, int64_t buffer_size); @@ -62,7 +64,7 @@ class AvroInputStream : public ::avro::SeekableInputStream { size_t available_bytes_ = 0; // bytes available in the buffer }; -class AvroOutputStream : public ::avro::OutputStream { +class ICEBERG_BUNDLE_EXPORT AvroOutputStream : public ::avro::OutputStream { public: explicit AvroOutputStream(std::shared_ptr<::arrow::io::OutputStream> output_stream, int64_t buffer_size); diff --git a/src/iceberg/file_reader.h b/src/iceberg/file_reader.h index d7e3b092d..7acc31e9f 100644 --- a/src/iceberg/file_reader.h +++ b/src/iceberg/file_reader.h @@ -68,7 +68,7 @@ struct ICEBERG_EXPORT Split { size_t length; }; -class ReaderProperties : public ConfigBase { +class ICEBERG_EXPORT ReaderProperties : public ConfigBase { public: template using Entry = const ConfigBase::Entry; diff --git a/src/iceberg/file_writer.h b/src/iceberg/file_writer.h index ea4e42389..06de50c70 100644 --- a/src/iceberg/file_writer.h +++ b/src/iceberg/file_writer.h @@ -35,7 +35,7 @@ namespace iceberg { -class WriterProperties : public ConfigBase { +class ICEBERG_EXPORT WriterProperties : public ConfigBase { public: template using Entry = const ConfigBase::Entry; diff --git a/src/iceberg/parquet/parquet_data_util_internal.h b/src/iceberg/parquet/parquet_data_util_internal.h index 4a4f88138..fa06f4d15 100644 --- a/src/iceberg/parquet/parquet_data_util_internal.h +++ b/src/iceberg/parquet/parquet_data_util_internal.h @@ -21,6 +21,7 @@ #include +#include "iceberg/iceberg_bundle_export.h" #include "iceberg/schema_util.h" namespace iceberg::parquet { @@ -33,7 +34,7 @@ namespace iceberg::parquet { /// \param projection The projection from projected Iceberg schema to the record batch. /// \param pool The arrow memory pool. /// \return The converted record batch. -Result> ProjectRecordBatch( +ICEBERG_BUNDLE_EXPORT Result> ProjectRecordBatch( std::shared_ptr<::arrow::RecordBatch> record_batch, const std::shared_ptr<::arrow::Schema>& output_arrow_schema, const Schema& projected_schema, const SchemaProjection& projection, diff --git a/src/iceberg/parquet/parquet_schema_util_internal.h b/src/iceberg/parquet/parquet_schema_util_internal.h index 8e06b0bcf..17989dec4 100644 --- a/src/iceberg/parquet/parquet_schema_util_internal.h +++ b/src/iceberg/parquet/parquet_schema_util_internal.h @@ -23,6 +23,7 @@ #include +#include "iceberg/iceberg_bundle_export.h" #include "iceberg/schema.h" #include "iceberg/schema_util.h" @@ -47,19 +48,21 @@ struct ParquetExtraAttributes : public FieldProjection::ExtraAttributes { /// \param parquet_schema The Parquet schema to read data from. /// \return The schema projection result with column indices of projected Parquet columns /// specified via ParquetExtraAttributes. -Result Project(const Schema& expected_schema, - const ::parquet::arrow::SchemaManifest& parquet_schema); +ICEBERG_BUNDLE_EXPORT Result Project( + const Schema& expected_schema, + const ::parquet::arrow::SchemaManifest& parquet_schema); /// \brief Get the selected column indices by walking through the projection result. /// /// \param projection The schema projection result. /// \return The selected column indices. -std::vector SelectedColumnIndices(const SchemaProjection& projection); +ICEBERG_BUNDLE_EXPORT std::vector SelectedColumnIndices( + const SchemaProjection& projection); /// \brief Check whether the Parquet schema has field IDs. /// /// \param root_node The root node of the Parquet schema. /// \return True if the Parquet schema has field IDs, false otherwise. -bool HasFieldIds(const ::parquet::schema::NodePtr& root_node); +ICEBERG_BUNDLE_EXPORT bool HasFieldIds(const ::parquet::schema::NodePtr& root_node); } // namespace iceberg::parquet diff --git a/src/iceberg/schema_internal.h b/src/iceberg/schema_internal.h index 5c7209d64..66e8d3e97 100644 --- a/src/iceberg/schema_internal.h +++ b/src/iceberg/schema_internal.h @@ -42,8 +42,8 @@ ICEBERG_EXPORT Status ToArrowSchema(const Schema& schema, ArrowSchema* out); /// \param[in] schema The Arrow schema to convert. /// \param[in] schema_id The schema ID of the Iceberg schema. /// \return The Iceberg schema or an error if the conversion fails. -Result> FromArrowSchema(const ArrowSchema& schema, - std::optional schema_id); +ICEBERG_EXPORT Result> FromArrowSchema( + const ArrowSchema& schema, std::optional schema_id); /// \brief Convert a struct type to an Iceberg schema. /// diff --git a/src/iceberg/util/gzip_internal.h b/src/iceberg/util/gzip_internal.h index 61cdc00b3..a688bd589 100644 --- a/src/iceberg/util/gzip_internal.h +++ b/src/iceberg/util/gzip_internal.h @@ -22,13 +22,14 @@ #include #include +#include "iceberg/iceberg_export.h" #include "iceberg/result.h" namespace iceberg { class ZlibImpl; -class GZipDecompressor { +class ICEBERG_EXPORT GZipDecompressor { public: GZipDecompressor(); diff --git a/src/iceberg/v1_metadata.h b/src/iceberg/v1_metadata.h index 4279230ab..ee57fff18 100644 --- a/src/iceberg/v1_metadata.h +++ b/src/iceberg/v1_metadata.h @@ -19,6 +19,7 @@ #pragma once +#include "iceberg/iceberg_export.h" #include "iceberg/manifest_adapter.h" /// \file iceberg/v1_metadata.h @@ -26,7 +27,7 @@ namespace iceberg { /// \brief Adapter to convert V1 ManifestEntry to `ArrowArray`. -class ManifestEntryAdapterV1 : public ManifestEntryAdapter { +class ICEBERG_EXPORT ManifestEntryAdapterV1 : public ManifestEntryAdapter { public: ManifestEntryAdapterV1(std::optional snapshot_id, std::shared_ptr partition_spec, @@ -45,7 +46,7 @@ class ManifestEntryAdapterV1 : public ManifestEntryAdapter { }; /// \brief Adapter to convert V1 ManifestFile to `ArrowArray`. -class ManifestFileAdapterV1 : public ManifestFileAdapter { +class ICEBERG_EXPORT ManifestFileAdapterV1 : public ManifestFileAdapter { public: ManifestFileAdapterV1(int64_t snapshot_id, std::optional parent_snapshot_id) : snapshot_id_(snapshot_id), parent_snapshot_id_(parent_snapshot_id) {} diff --git a/src/iceberg/v2_metadata.h b/src/iceberg/v2_metadata.h index 4459d9bce..826ab08d8 100644 --- a/src/iceberg/v2_metadata.h +++ b/src/iceberg/v2_metadata.h @@ -21,12 +21,13 @@ /// \file iceberg/v2_metadata.h +#include "iceberg/iceberg_export.h" #include "iceberg/manifest_adapter.h" namespace iceberg { /// \brief Adapter to convert V2 ManifestEntry to `ArrowArray`. -class ManifestEntryAdapterV2 : public ManifestEntryAdapter { +class ICEBERG_EXPORT ManifestEntryAdapterV2 : public ManifestEntryAdapter { public: ManifestEntryAdapterV2(std::optional snapshot_id, std::shared_ptr partition_spec, @@ -51,7 +52,7 @@ class ManifestEntryAdapterV2 : public ManifestEntryAdapter { }; /// \brief Adapter to convert V2 ManifestFile to `ArrowArray`. -class ManifestFileAdapterV2 : public ManifestFileAdapter { +class ICEBERG_EXPORT ManifestFileAdapterV2 : public ManifestFileAdapter { public: ManifestFileAdapterV2(int64_t snapshot_id, std::optional parent_snapshot_id, int64_t sequence_number) diff --git a/src/iceberg/v3_metadata.h b/src/iceberg/v3_metadata.h index a8262bc67..7983fa134 100644 --- a/src/iceberg/v3_metadata.h +++ b/src/iceberg/v3_metadata.h @@ -21,12 +21,13 @@ /// \file iceberg/v3_metadata.h +#include "iceberg/iceberg_export.h" #include "iceberg/manifest_adapter.h" namespace iceberg { /// \brief Adapter to convert V3 ManifestEntry to `ArrowArray`. -class ManifestEntryAdapterV3 : public ManifestEntryAdapter { +class ICEBERG_EXPORT ManifestEntryAdapterV3 : public ManifestEntryAdapter { public: ManifestEntryAdapterV3(std::optional snapshot_id, std::optional first_row_id, @@ -57,7 +58,7 @@ class ManifestEntryAdapterV3 : public ManifestEntryAdapter { }; /// \brief Adapter to convert V3 ManifestFile to `ArrowArray`. -class ManifestFileAdapterV3 : public ManifestFileAdapter { +class ICEBERG_EXPORT ManifestFileAdapterV3 : public ManifestFileAdapter { public: ManifestFileAdapterV3(int64_t snapshot_id, std::optional parent_snapshot_id, int64_t sequence_number, int64_t first_row_id)