rdblue commented on a change in pull request #2293:
URL: https://github.com/apache/iceberg/pull/2293#discussion_r600001818
##########
File path: core/src/main/java/org/apache/iceberg/BaseRewriteFiles.java
##########
@@ -57,4 +64,11 @@ public RewriteFiles rewriteFiles(Set<DataFile>
filesToDelete, Set<DataFile> file
return this;
}
+
+ @Override
+ public RewriteFiles rewriteSpec(PartitionSpec newSpec) {
+
Preconditions.checkArgument(current().specsById().containsKey(newSpec.specId()),
+ "Invalid spec with id %d", newSpec.specId());
+ return new BaseRewriteFiles(tableName(), ops(), newSpec);
Review comment:
Not returning `this` breaks method chaining because you can't do this:
```java
RewriteFiles rewrite = table.newRewriteFiles();
if (!spec.equals(table.spec())) {
rewrite.rewriteSpec(spec);
}
rewrite.commit();
```
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]