wgtmac commented on code in PR #143:
URL: https://github.com/apache/iceberg-cpp/pull/143#discussion_r2191968847
##########
src/iceberg/manifest_reader.h:
##########
@@ -34,19 +34,17 @@ namespace iceberg {
/// \brief Read manifest entries from a manifest file.
class ICEBERG_EXPORT ManifestReader {
public:
- virtual Result<std::span<std::unique_ptr<ManifestEntry>>> Entries() const =
0;
+ virtual Result<std::vector<std::unique_ptr<ManifestEntry>>> Entries() const
= 0;
- private:
- std::unique_ptr<Reader> reader_;
+ static std::shared_ptr<ManifestReader> NewReader(std::unique_ptr<Reader>
reader);
Review Comment:
BTW, should we create the reader internally using ReaderFactory? We know the
manifest schema and file format. Sometimes it is useful to directly return
Arrow arrays of manifest entries. Therefore I propose the following interface
and make them all static functions:
```cpp
class ICEBERG_EXPORT ManifestReader {
public:
static Result<std::unique_ptr<Reader>> MakeReader(
const std::string& manifest_list_location,
FileIO& file_io,
std::shared_ptr<Schema> schema = kManifestSchema);
static Result<std::vector<std::unique_ptr<ManifestEntry>>> ReadEntries(
const std::string& manifest_list_location,
FileIO& file_io);
};
```
--
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]