aokolnychyi commented on a change in pull request #2503: URL: https://github.com/apache/iceberg/pull/2503#discussion_r627846861
########## File path: spark3/src/main/java/org/apache/iceberg/spark/actions/BaseSnapshotTableSparkAction.java ########## @@ -109,7 +109,8 @@ public SnapshotTable tableProperty(String property, String value) { @Override public SnapshotTable.Result execute() { - JobGroupInfo info = newJobGroupInfo("SNAPSHOT-TABLE", "SNAPSHOT-TABLE"); + JobGroupInfo info = newJobGroupInfo("SNAPSHOT-TABLE", + String.format("Snapshotting table %s as %s", sourceTableIdent().toString(), destTableIdent.toString())); Review comment: Do we need to call toString explicitly? Can we also put the description into a separate var so that this fits on one line? ``` String desc = String.format("Snapshotting table %s as %s", sourceTableIdent(), destTableIdent); ``` ########## File path: spark/src/main/java/org/apache/iceberg/spark/actions/BaseExpireSnapshotsSparkAction.java ########## @@ -181,10 +184,32 @@ public BaseExpireSnapshotsSparkAction deleteWith(Consumer<String> newDeleteFunc) @Override public ExpireSnapshots.Result execute() { - JobGroupInfo info = newJobGroupInfo("EXPIRE-SNAPSHOTS", "EXPIRE-SNAPSHOTS"); + JobGroupInfo info = newJobGroupInfo("EXPIRE-SNAPSHOTS", jobDesc()); return withJobGroupInfo(info, this::doExecute); } + private String jobDesc() { + List<String> options = Lists.newArrayList(); + if (expireOlderThanValue != null) { + options.add("older_than=" + expireOlderThanValue); + } + + if (retainLastValue != null) { + options.add("retain_last=" + retainLastValue); + } + + if (!expiredSnapshotIds.isEmpty()) { + Long first = expiredSnapshotIds.stream().findFirst().get(); + if (expiredSnapshotIds.size() > 1) { + options.add(String.format("snapshot_ids: %s (%s more...)", first, expiredSnapshotIds.size() - 1)); + } else { + options.add(String.format("snapshot_id: %s", first)); + } + } + + return String.format("Expiring snapshots(%s) in %s", Joiner.on(',').join(options), table.name()); Review comment: nit: space before `(` ########## File path: spark/src/main/java/org/apache/iceberg/spark/actions/BaseExpireSnapshotsSparkAction.java ########## @@ -181,10 +184,32 @@ public BaseExpireSnapshotsSparkAction deleteWith(Consumer<String> newDeleteFunc) @Override public ExpireSnapshots.Result execute() { - JobGroupInfo info = newJobGroupInfo("EXPIRE-SNAPSHOTS", "EXPIRE-SNAPSHOTS"); + JobGroupInfo info = newJobGroupInfo("EXPIRE-SNAPSHOTS", jobDesc()); return withJobGroupInfo(info, this::doExecute); } + private String jobDesc() { + List<String> options = Lists.newArrayList(); Review comment: nit: let's add one more empty line after options -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org