Skip to content

Commit 7a34102

Browse files
committed
fix build failure
1 parent 225266c commit 7a34102

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/iceberg/partition_spec.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <cstddef>
2424
#include <cstdint>
2525
#include <format>
26+
#include <map>
2627
#include <memory>
2728
#include <ranges>
2829
#include <unordered_map>
@@ -265,19 +266,21 @@ bool PartitionSpec::HasSequentialFieldIds(const PartitionSpec& spec) {
265266

266267
Status PartitionSpec::ValidateRedundantPartitions(const PartitionSpec& spec) {
267268
// Use a map to track deduplication keys (source_id + transform dedup name)
268-
std::unordered_map<std::pair<int32_t, std::string>, const PartitionField*> dedup_fields;
269+
std::map<std::pair<int32_t, std::string>, const PartitionField*> dedup_fields;
269270

270271
for (const auto& field : spec.fields()) {
271-
// Create dedup key: (source_id, transform_dedup_name)
272+
// The dedup name is provided by the transform's DedupName() method
273+
// which typically returns the transform's string representation
272274
auto dedup_key = std::make_pair(field.source_id(), field.transform()->DedupName());
273275

274276
// Check if this dedup key already exists
277+
// If it does, we have found a redundant partition field
275278
auto existing_field_iter = dedup_fields.find(dedup_key);
276279
ICEBERG_PRECHECK(existing_field_iter == dedup_fields.end(),
277280
"Cannot add redundant partition: {} conflicts with {}",
278281
field.ToString(), existing_field_iter->second->ToString());
279282

280-
// Add this field to the dedup map
283+
// Add this field to the dedup map for future conflict detection
281284
dedup_fields[dedup_key] = &field;
282285
}
283286

0 commit comments

Comments
 (0)