wgtmac commented on code in PR #299:
URL: https://github.com/apache/iceberg-cpp/pull/299#discussion_r2512981451
##########
src/iceberg/manifest_writer.cc:
##########
@@ -102,9 +128,22 @@ 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()) {
+ return InvalidArgument("Manifest location cannot be empty");
+ }
+ if (!file_io) {
+ return InvalidArgument("FileIO cannot be null");
+ }
+ if (!partition_spec) {
+ return InvalidArgument("PartitionSpec cannot be null");
+ }
+ if (!current_schema) {
+ return InvalidArgument("Current schema cannot be null");
+ }
Review Comment:
```suggestion
```
##########
src/iceberg/manifest_writer.cc:
##########
@@ -102,9 +128,22 @@ 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) {
Review Comment:
```suggestion
ManifestContent content) {
if (manifest_location.empty()) {
return InvalidArgument("Manifest location cannot be empty");
}
if (!file_io) {
return InvalidArgument("FileIO cannot be null");
}
if (!partition_spec) {
return InvalidArgument("PartitionSpec cannot be null");
}
if (!current_schema) {
return InvalidArgument("Current schema cannot be null");
}
```
##########
src/iceberg/manifest_writer.cc:
##########
@@ -102,9 +128,22 @@ 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);
Review Comment:
```suggestion
snapshot_id, first_row_id, std::move(partition_spec),
std::move(current_schema), content);
```
--
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]