dongxiao1198 commented on code in PR #216:
URL: https://github.com/apache/iceberg-cpp/pull/216#discussion_r2342865281
##########
src/iceberg/manifest_adapter.h:
##########
@@ -33,34 +40,104 @@ class ICEBERG_EXPORT ManifestAdapter {
public:
ManifestAdapter() = default;
virtual ~ManifestAdapter() = default;
+ virtual Status Init() = 0;
- virtual Status StartAppending() = 0;
- virtual Result<ArrowArray> FinishAppending() = 0;
+ Status StartAppending();
+ Result<ArrowArray> FinishAppending();
int64_t size() const { return size_; }
+ virtual std::shared_ptr<Schema> schema() const = 0;
+
+ protected:
+ static Status AppendField(ArrowArray* arrowArray, int64_t value);
+ static Status AppendField(ArrowArray* arrowArray, uint64_t value);
+ static Status AppendField(ArrowArray* arrowArray, double value);
+ static Status AppendField(ArrowArray* arrowArray, std::string_view value);
+ static Status AppendField(ArrowArray* arrowArray, const
std::vector<uint8_t>& value);
+ static Status AppendField(ArrowArray* arrowArray, const std::array<uint8_t,
16>& value);
protected:
+ bool is_initialized_ = false;
ArrowArray array_;
+ ArrowSchema schema_; // converted from manifest_schema_ or
manifest_list_schema_
int64_t size_ = 0;
};
// \brief Implemented by different versions with different schemas to
// append a list of `ManifestEntry`s to an `ArrowArray`.
class ICEBERG_EXPORT ManifestEntryAdapter : public ManifestAdapter {
public:
- ManifestEntryAdapter() = default;
- ~ManifestEntryAdapter() override = default;
+ explicit ManifestEntryAdapter(std::shared_ptr<Schema> partition_schema,
+ std::shared_ptr<PartitionSpec> partition_spec)
Review Comment:
Oh, I see the impl of java, it's ok for us. I will add a transformer to get
this schema from spec directly
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]