You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "wgtmac (via GitHub)" <gi...@apache.org> on 2025/11/10 09:35:01 UTC
Re: [PR] refactor: change PartitionSpec to be independent of Schema [iceberg-cpp]
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org