HeartLinked commented on code in PR #178:
URL: https://github.com/apache/iceberg-cpp/pull/178#discussion_r2281185450


##########
src/iceberg/manifest_reader.cc:
##########
@@ -27,7 +28,33 @@
 
 namespace iceberg {
 
-Result<std::unique_ptr<ManifestReader>> ManifestReader::MakeReader(
+Result<std::unique_ptr<ManifestReader>> ManifestReader::Make(
+    const ManifestFile& manifest, std::shared_ptr<FileIO> file_io,
+    std::shared_ptr<Schema> partition_schema) {
+  // Validate manifest content type - only DATA manifests are supported by 
ManifestReader
+  if (manifest.content != ManifestFile::Content::kData) {
+    return InvalidArgument("Cannot read a delete manifest with a 
ManifestReader: {}",
+                           manifest.manifest_path);
+  }
+
+  auto manifest_entry_schema = 
ManifestEntry::TypeFromPartitionType(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);

Review Comment:
   fixed.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to