zhjwpku commented on code in PR #1159:
URL: https://github.com/apache/iceberg-cpp/pull/1159#discussion_r4664138772
##########
src/iceberg/delete_file_index.cc:
##########
@@ -44,6 +44,38 @@
namespace iceberg {
+namespace {
+std::string DescribePartition(const PartitionValues& partition) {
+ std::string result = "(";
+ for (const auto& value : partition.values()) {
+ if (result.size() > 1) {
+ result += ", ";
+ }
+ result += value.ToString();
+ }
+ return result + ")";
+}
+
+Status ValidatePartitionMatch(const DataFile& deletion, const DataFile& data) {
+ ICEBERG_CHECK(deletion.partition_spec_id == data.partition_spec_id,
Review Comment:
nit: `ForDataFile` is also called from commit validation
(`ValidateNoNewDeletesForDataFiles`) with a `DataFile` built by the caller. If
that file has no `partition_spec_id`, this check reports "Mismatched partition
specs (1, -1) ... metadata is corrupted", although the metadata is fine. Maybe
check `data.partition_spec_id.has_value()` first and report "Missing partition
spec id from data file {}", like the other lookups in this file do?
##########
src/iceberg/delete_file_index.cc:
##########
@@ -44,6 +44,38 @@
namespace iceberg {
+namespace {
+std::string DescribePartition(const PartitionValues& partition) {
Review Comment:
nit: would it make sense to add `ToString()` to `PartitionValues`?
--
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]