nastra commented on a change in pull request #3257:
URL: https://github.com/apache/iceberg/pull/3257#discussion_r752025665
##########
File path:
nessie/src/main/java/org/apache/iceberg/nessie/NessieTableOperations.java
##########
@@ -127,14 +155,32 @@ protected void doCommit(TableMetadata base, TableMetadata
metadata) {
delete = false;
throw new CommitStateUnknownException(ex);
} catch (NessieNotFoundException ex) {
- throw new RuntimeException(String.format("Commit failed: Reference %s no
longer exist", reference.getName()), ex);
+ throw new RuntimeException(
+ String.format("Commit failed: Reference %s no longer exist",
reference.getName()), ex);
} finally {
if (delete) {
io().deleteFile(newMetadataLocation);
}
}
}
+ private ImmutableCommitMeta.Builder buildCommitMessage(TableMetadata base,
TableMetadata metadata) {
+ Builder commitMeta = ImmutableCommitMeta.builder();
+ String commitMessage;
+ Snapshot snapshot = metadata.currentSnapshot();
+ if (snapshot != null && (base == null || base.currentSnapshot() == null ||
+ snapshot.snapshotId() != base.currentSnapshot().snapshotId())) {
+ commitMessage = String.format("Iceberg %s against %s",
snapshot.operation(), tableName());
+ commitMeta.putProperties("iceberg.operation", snapshot.operation());
+ } else if (base != null && metadata.currentSchemaId() !=
base.currentSchemaId()) {
+ commitMessage = String.format("Iceberg schema change against %s",
tableName());
+ } else {
+ commitMessage = String.format("Iceberg commit against %s", tableName());
+ }
+
+ return commitMeta.message(commitMessage);
Review comment:
improved
--
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]