RussellSpitzer commented on code in PR #9803: URL: https://github.com/apache/iceberg/pull/9803#discussion_r1504774505
########## core/src/main/java/org/apache/iceberg/actions/SizeBasedFileRewriter.java: ########## @@ -258,6 +261,24 @@ protected long writeMaxFileSize() { return (long) (targetFileSize + ((maxFileSize - targetFileSize) * 0.5)); } + /** + * returns already set outputSpecId rewriter will use, value is set by user using `output-spec-id` + * see more {@link #outputSpecId(Map)} + */ + protected int outputSpecId() { + return outputSpecId; + } + + private int outputSpecId(Map<String, String> options) { + int specId = + PropertyUtil.propertyAsInt(options, RewriteDataFiles.OUTPUT_SPEC_ID, table.spec().specId()); + Preconditions.checkArgument( + table.specs().containsKey(specId), + "Output spec id %s is not a valid spec id for table", Review Comment: Generally we follow the pattern "Cannot x because y. (Possible remediation z)" So "Cannot use output spec id %d because the table does not contain a reference to this spec-id." Or something like that -- 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: issues-unsubscr...@iceberg.apache.org 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