RussellSpitzer commented on code in PR #7501:
URL: https://github.com/apache/iceberg/pull/7501#discussion_r1183096753
##########
api/src/main/java/org/apache/iceberg/RewriteFiles.java:
##########
@@ -34,13 +34,72 @@
* will throw a {@link ValidationException}.
*/
public interface RewriteFiles extends SnapshotUpdate<RewriteFiles> {
+ /**
+ * Delete a data file whose content was rewritten.
+ *
+ * @param dataFile a rewritten data file
+ * @return this for method chaining
+ */
+ default RewriteFiles deleteFile(DataFile dataFile) {
+ throw new UnsupportedOperationException(
+ this.getClass().getName() + " does not implement deleteFile");
+ }
+
+ /**
+ * Delete a delete file whose content was rewritten.
+ *
+ * @param deleteFile a rewritten delete file
+ * @return this for method chaining
+ */
+ default RewriteFiles deleteFile(DeleteFile deleteFile) {
+ throw new UnsupportedOperationException(
+ this.getClass().getName() + " does not implement deleteFile");
+ }
+
+ /**
+ * Add a new data file.
+ *
+ * @param dataFile a new data file
+ * @return this for method chaining
+ */
+ default RewriteFiles addFile(DataFile dataFile) {
+ throw new UnsupportedOperationException(
+ this.getClass().getName() + " does not implement addFile");
+ }
+
+ /**
+ * Add a new delete file.
+ *
+ * @param deleteFile a new delete file
+ * @return this for method chaining
+ */
+ default RewriteFiles addFile(DeleteFile deleteFile) {
Review Comment:
Do we want to specify that adding the same delete file/data file twice will
have no effect? We required set's before
##########
api/src/main/java/org/apache/iceberg/RewriteFiles.java:
##########
@@ -34,13 +34,72 @@
* will throw a {@link ValidationException}.
*/
public interface RewriteFiles extends SnapshotUpdate<RewriteFiles> {
+ /**
+ * Delete a data file whose content was rewritten.
+ *
+ * @param dataFile a rewritten data file
+ * @return this for method chaining
+ */
+ default RewriteFiles deleteFile(DataFile dataFile) {
+ throw new UnsupportedOperationException(
+ this.getClass().getName() + " does not implement deleteFile");
+ }
+
+ /**
+ * Delete a delete file whose content was rewritten.
+ *
+ * @param deleteFile a rewritten delete file
+ * @return this for method chaining
+ */
+ default RewriteFiles deleteFile(DeleteFile deleteFile) {
+ throw new UnsupportedOperationException(
+ this.getClass().getName() + " does not implement deleteFile");
+ }
+
+ /**
+ * Add a new data file.
+ *
+ * @param dataFile a new data file
+ * @return this for method chaining
+ */
+ default RewriteFiles addFile(DataFile dataFile) {
+ throw new UnsupportedOperationException(
+ this.getClass().getName() + " does not implement addFile");
+ }
+
+ /**
+ * Add a new delete file.
+ *
+ * @param deleteFile a new delete file
+ * @return this for method chaining
+ */
+ default RewriteFiles addFile(DeleteFile deleteFile) {
Review Comment:
Do we want to specify that adding the same delete file/data file twice will
have no effect? We required set
s before
--
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]