rdblue commented on code in PR #11323:
URL: https://github.com/apache/iceberg/pull/11323#discussion_r1815781801
##########
core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java:
##########
@@ -138,20 +138,16 @@ protected boolean isCaseSensitive() {
}
protected PartitionSpec dataSpec() {
- Set<PartitionSpec> specs = dataSpecs();
+ Set<PartitionSpec> specs =
+
newDataFilesBySpec.keySet().stream().map(this::spec).collect(ImmutableSet.toImmutableSet());
Review Comment:
This seems a bit over-complicated. At the end of this method, there will be
just one spec, so why look up all the specs by ID and then fail? I think this
should look more like this:
```java
Set<Integer> specs = newDataFilesBySpec.keySet();
Preconditions...
return spec(Iterables.getOnlyElement(specs));
```
--
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]