fbocse commented on a change in pull request #74: Add snapshot summary and
operation.
URL: https://github.com/apache/incubator-iceberg/pull/74#discussion_r253786391
##########
File path: core/src/main/java/com/netflix/iceberg/SnapshotUpdate.java
##########
@@ -273,4 +328,31 @@ private static ManifestFile addMetadata(TableOperations
ops, ManifestFile manife
throw new RuntimeIOException(e, "Failed to read manifest: %s",
manifest.path());
}
}
+
+ private static void updateTotal(ImmutableMap.Builder<String, String>
summaryBuilder,
+ Map<String, String> previousSummary, String
totalProperty,
+ Map<String, String> currentSummary,
+ String addedProperty, String
deletedProperty) {
+ String totalStr = previousSummary.get(totalProperty);
+ if (totalStr != null) {
Review comment:
I have a question on this particular branch and I don't know if it's valid
or worth looking into so I'm looking for your opinion on this.
Say we get a `NumberFormatException` when attempting to parse a long out of
`TOTAL_RECORDS_PROP` and that basically has the code failing to set this
particular total property in the current snapshot summary. But other
properties, such as `TOTAL_FILES_PROP`, do get included, so the current
snapshot has a summary, but it's missing the `TOTAL_RECORDS_PROP` property.
That's possible right, an incomplete summary?
Now, following snapshot comes along, load current snapshot's summary and
looks up `TOTAL_RECORDS_PROP` so it gets a null and skips the branch altogether
and I think that this effect gets propagated indefinitely, right?
So I guess the question is whether the code should attempt to stop erroneous
total properties (or their effects) from getting propagated onto following
snapshot summaries?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]