wgtmac commented on code in PR #299:
URL: https://github.com/apache/iceberg-cpp/pull/299#discussion_r2509552959


##########
src/iceberg/manifest_writer.cc:
##########
@@ -102,9 +110,14 @@ Result<std::unique_ptr<ManifestWriter>> 
ManifestWriter::MakeV2Writer(
 Result<std::unique_ptr<ManifestWriter>> ManifestWriter::MakeV3Writer(
     std::optional<int64_t> snapshot_id, std::optional<int64_t> first_row_id,
     std::string_view manifest_location, std::shared_ptr<FileIO> file_io,
-    std::shared_ptr<PartitionSpec> partition_spec, ManifestContent content) {
+    std::shared_ptr<PartitionSpec> partition_spec, std::shared_ptr<Schema> 
current_schema,
+    ManifestContent content) {
   auto adapter = std::make_unique<ManifestEntryAdapterV3>(
-      snapshot_id, first_row_id, std::move(partition_spec), content);
+      snapshot_id, first_row_id, std::move(partition_spec), current_schema, 
content);
+  if (manifest_location.empty() || !file_io || !partition_spec || 
!current_schema) {

Review Comment:
   We should check inputs before anything.



##########
src/iceberg/manifest_writer.cc:
##########
@@ -70,9 +70,14 @@ Result<std::unique_ptr<Writer>> OpenFileWriter(
 
 Result<std::unique_ptr<ManifestWriter>> ManifestWriter::MakeV1Writer(
     std::optional<int64_t> snapshot_id, std::string_view manifest_location,
-    std::shared_ptr<FileIO> file_io, std::shared_ptr<PartitionSpec> 
partition_spec) {
-  auto adapter =
-      std::make_unique<ManifestEntryAdapterV1>(snapshot_id, 
std::move(partition_spec));
+    std::shared_ptr<FileIO> file_io, std::shared_ptr<PartitionSpec> 
partition_spec,
+    std::shared_ptr<Schema> current_schema) {
+  if (manifest_location.empty() || !file_io || !partition_spec || 
!current_schema) {

Review Comment:
   nit: I don't think this is really useful to use a single check without any 
detail error message.



-- 
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]

Reply via email to