rdblue commented on a change in pull request #2293:
URL: https://github.com/apache/iceberg/pull/2293#discussion_r600001056
##########
File path: core/src/main/java/org/apache/iceberg/BaseRewriteFiles.java
##########
@@ -46,6 +51,8 @@ public RewriteFiles rewriteFiles(Set<DataFile> filesToDelete,
Set<DataFile> file
"Files to delete cannot be null or empty");
Preconditions.checkArgument(filesToAdd != null && !filesToAdd.isEmpty(),
"Files to add can not be null or empty");
+ Preconditions.checkArgument(filesToAdd.stream().allMatch(df -> df.specId()
== writeSpec().specId()),
+ "Files to add can not have a different spec than the rewrite files
spec");
Review comment:
Should we just detect the spec that is used? Why make the user set the
spec if we have it for each new data file?
If we didn't need to set the spec, then we could eventually support rewrites
that produce multiple specs.
--
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]