Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/iceberg/manifest_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@
#include "iceberg/manifest_reader_internal.h"
#include "iceberg/schema.h"
#include "iceberg/schema_internal.h"
#include "iceberg/type.h"
#include "iceberg/util/macros.h"

namespace iceberg {

Result<std::unique_ptr<ManifestReader>> ManifestReader::Make(
const ManifestFile& manifest, std::shared_ptr<FileIO> file_io,
std::shared_ptr<Schema> partition_schema) {
auto manifest_entry_schema = ManifestEntry::TypeFromPartitionType(partition_schema);
std::shared_ptr<StructType> partition_schema) {
auto manifest_entry_schema =
ManifestEntry::TypeFromPartitionType(std::move(partition_schema));
std::shared_ptr<Schema> schema =
FromStructType(std::move(*manifest_entry_schema), std::nullopt);

Expand All @@ -51,8 +53,9 @@ Result<std::unique_ptr<ManifestReader>> ManifestReader::Make(

Result<std::unique_ptr<ManifestReader>> ManifestReader::Make(
std::string_view manifest_location, std::shared_ptr<FileIO> file_io,
std::shared_ptr<Schema> partition_schema) {
auto manifest_entry_schema = ManifestEntry::TypeFromPartitionType(partition_schema);
std::shared_ptr<StructType> partition_schema) {
auto manifest_entry_schema =
ManifestEntry::TypeFromPartitionType(std::move(partition_schema));
auto fields_span = manifest_entry_schema->fields();
std::vector<SchemaField> fields(fields_span.begin(), fields_span.end());
auto schema = std::make_shared<Schema>(fields);
Expand Down
5 changes: 3 additions & 2 deletions src/iceberg/manifest_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include "iceberg/iceberg_export.h"
#include "iceberg/result.h"
#include "iceberg/type.h"
#include "iceberg/type_fwd.h"

namespace iceberg {
Expand All @@ -44,7 +45,7 @@ class ICEBERG_EXPORT ManifestReader {
/// \return A Result containing the reader or an error.
static Result<std::unique_ptr<ManifestReader>> Make(
const ManifestFile& manifest, std::shared_ptr<FileIO> file_io,
std::shared_ptr<Schema> partition_schema);
std::shared_ptr<StructType> partition_schema);

/// \brief Creates a reader for a manifest file.
/// \param manifest_location Path to the manifest file.
Expand All @@ -53,7 +54,7 @@ class ICEBERG_EXPORT ManifestReader {
/// \return A Result containing the reader or an error.
static Result<std::unique_ptr<ManifestReader>> Make(
std::string_view manifest_location, std::shared_ptr<FileIO> file_io,
std::shared_ptr<Schema> partition_schema);
std::shared_ptr<StructType> partition_schema);
};

/// \brief Read manifest files from a manifest list file.
Expand Down
Loading