kbendick commented on code in PR #5009:
URL: https://github.com/apache/iceberg/pull/5009#discussion_r919711098
##########
core/src/main/java/org/apache/iceberg/SnapshotSummary.java:
##########
@@ -186,7 +187,13 @@ public Map<String, String> build() {
metrics.addTo(builder);
setIf(deletedDuplicateFiles > 0, builder, DELETED_DUPLICATE_FILES,
deletedDuplicateFiles);
- Set<String> changedPartitions = partitionMetrics.keySet();
+ // Exclude the key that corresponds to PartitionSpec.unpartitioned().
+ // We might want to keep it if and only if the table has had its
partition spec updated over time and the
+ // write hit two specs (unpartitioned / VOID and an actual bound
partition spec).
+ Set<String> changedPartitions = partitionMetrics.keySet()
+ .stream()
+ .filter(partKey -> partKey != null && !partKey.isEmpty())
+ .collect(Collectors.toSet());
Review Comment:
I considered that, but we don't have access to `isPartitioned` here. What we
know about the table's partitioning comes from the metrics and the partition
keys.
I agree that's cleaner but requires more of a refactor. I'm going to update
to simply not write a summary for the root partition (i.e. unpartitioned
tables).
--
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]