pvary commented on code in PR #14312:
URL: https://github.com/apache/iceberg/pull/14312#discussion_r2455056623
##########
flink/v2.0/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DynamicCommitter.java:
##########
@@ -200,27 +198,27 @@ private void commitPendingRequests(
throws IOException {
long checkpointId = commitRequestMap.lastKey();
List<ManifestFile> manifests = Lists.newArrayList();
- NavigableMap<Long, List<WriteResult>> pendingResults = Maps.newTreeMap();
+ NavigableMap<Long, WriteResult> pendingResults = Maps.newTreeMap();
for (Map.Entry<Long, List<CommitRequest<DynamicCommittable>>> e :
commitRequestMap.entrySet()) {
+ WriteResult.Builder builder = WriteResult.builder();
for (CommitRequest<DynamicCommittable> committable : e.getValue()) {
- if (Arrays.equals(EMPTY_MANIFEST_DATA,
committable.getCommittable().manifest())) {
- pendingResults
- .computeIfAbsent(e.getKey(), unused -> Lists.newArrayList())
- .add(EMPTY_WRITE_RESULT);
- } else {
- DeltaManifests deltaManifests =
- SimpleVersionedSerialization.readVersionAndDeSerialize(
- DeltaManifestsSerializer.INSTANCE,
committable.getCommittable().manifest());
- pendingResults
- .computeIfAbsent(e.getKey(), unused -> Lists.newArrayList())
- .add(FlinkManifestUtil.readCompletedFiles(deltaManifests,
table.io(), table.specs()));
- manifests.addAll(deltaManifests.manifests());
+ if (!Arrays.deepEquals(EMPTY_MANIFEST_DATA,
committable.getCommittable().manifests())) {
+ for (byte[] manifest : committable.getCommittable().manifests()) {
+ DeltaManifests deltaManifests =
+ SimpleVersionedSerialization.readVersionAndDeSerialize(
+ DeltaManifestsSerializer.INSTANCE, manifest);
+ builder.add(
+ FlinkManifestUtil.readCompletedFiles(deltaManifests,
table.io(), table.specs()));
+ manifests.addAll(deltaManifests.manifests());
+ }
}
+
+ pendingResults.put(e.getKey(), builder.build());
}
}
- CommitSummary summary = new CommitSummary();
- summary.addAll(pendingResults);
+ // TODO: Fix aggregated commit summary logged multiple times per each each
checkpoint commit
Review Comment:
I don't get this comment. Could you please elaborate?
--
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]