You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2020/08/25 00:11:48 UTC
[GitHub] [iceberg] rdblue opened a new pull request #1375: Add expire method to ExpireSnapshotsAction
rdblue opened a new pull request #1375:
URL: https://github.com/apache/iceberg/pull/1375
This adds an `expire` method to the `ExpireSnapshotsAction` that makes the set of expired files available as a `Dataset`. This can be called before, after, or in place of `execute`.
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue commented on a change in pull request #1375: Add expire method to ExpireSnapshotsAction
Posted by GitBox <gi...@apache.org>.
rdblue commented on a change in pull request #1375:
URL: https://github.com/apache/iceberg/pull/1375#discussion_r476690945
##########
File path: spark/src/main/java/org/apache/iceberg/actions/ExpireSnapshotsAction.java
##########
@@ -146,32 +147,48 @@ public ExpireSnapshotsAction deleteWith(Consumer<String> newDeleteFunc) {
return this;
}
- @Override
- public ExpireSnapshotsActionResult execute() {
- // Metadata before Expiration
- Dataset<Row> originalFiles = buildValidFileDF(ops.current());
+ /**
+ * Expires snapshots and commits the changes to the table, returning a Dataset of files to delete.
+ * <p>
+ * This does not delete data files. To delete data files, run {@link #execute()}.
+ * <p>
+ * This may be called before or after {@link #execute()} is called to return the expired file list.
+ *
+ * @return a Dataset of files that are no longer referenced by the table
+ */
+ public Dataset<Row> expire() {
+ if (expiredFiles == null) {
Review comment:
I'd rather not over-complicate it. If there is a future use case for multiple threads we can do it then, but I really doubt it will be needed.
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue merged pull request #1375: Add expire method to ExpireSnapshotsAction
Posted by GitBox <gi...@apache.org>.
rdblue merged pull request #1375:
URL: https://github.com/apache/iceberg/pull/1375
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue commented on pull request #1375: Add expire method to ExpireSnapshotsAction
Posted by GitBox <gi...@apache.org>.
rdblue commented on pull request #1375:
URL: https://github.com/apache/iceberg/pull/1375#issuecomment-680138675
Rebased to pick up the ORC fix.
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] rdblue commented on pull request #1375: Add expire method to ExpireSnapshotsAction
Posted by GitBox <gi...@apache.org>.
rdblue commented on pull request #1375:
URL: https://github.com/apache/iceberg/pull/1375#issuecomment-680267373
Thanks for reviewing, @RussellSpitzer and @aokolnychyi!
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
[GitHub] [iceberg] RussellSpitzer commented on a change in pull request #1375: Add expire method to ExpireSnapshotsAction
Posted by GitBox <gi...@apache.org>.
RussellSpitzer commented on a change in pull request #1375:
URL: https://github.com/apache/iceberg/pull/1375#discussion_r476629486
##########
File path: spark/src/main/java/org/apache/iceberg/actions/ExpireSnapshotsAction.java
##########
@@ -146,32 +147,48 @@ public ExpireSnapshotsAction deleteWith(Consumer<String> newDeleteFunc) {
return this;
}
- @Override
- public ExpireSnapshotsActionResult execute() {
- // Metadata before Expiration
- Dataset<Row> originalFiles = buildValidFileDF(ops.current());
+ /**
+ * Expires snapshots and commits the changes to the table, returning a Dataset of files to delete.
+ * <p>
+ * This does not delete data files. To delete data files, run {@link #execute()}.
+ * <p>
+ * This may be called before or after {@link #execute()} is called to return the expired file list.
+ *
+ * @return a Dataset of files that are no longer referenced by the table
+ */
+ public Dataset<Row> expire() {
+ if (expiredFiles == null) {
Review comment:
Should we be synchronizing on expired files? Probably a really unlikely situation to be calling this object in a multi-threaded way or to call expire and execute concurrently ...
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org