Core: Fix the incorrectly log description in BinPackStrategy#3919
Core: Fix the incorrectly log description in BinPackStrategy#3919rdblue merged 3 commits intoapache:masterfrom
Conversation
| MIN_FILE_SIZE_BYTES, RewriteDataFiles.TARGET_FILE_SIZE_BYTES, minFileSize, targetFileSize); | ||
|
|
||
| Preconditions.checkArgument(targetFileSize < maxFileSize, | ||
| "Cannot set %s is greater than or equal to %s, all files written will be larger than the threshold, %d >= %d", |
There was a problem hiding this comment.
I think the correct fix is to reverse MAX_FILE_SIZE_BYTES and RewriteDataFiles.TARGET_FILE_SIZE_BYTES. Leaving "or equal to" doesn't work.
There was a problem hiding this comment.
If MAX_FILE_SIZE_BYTES equals to TARGET_FILE_SIZE_BYTES, argument check still works and throws this exception. Anyway, there is a mistake I forget to fix "%d >= %d" with parameters, I will reverse targetFileSize and maxFileSize later.
thanks for your comment
There was a problem hiding this comment.
I think this is incorrect for the equals case. Can you revert the message changes and swap the argument order?
There was a problem hiding this comment.
OK, I will follow your advice, swap the argument order.
|
Thanks, @Zhangg7723! Looks good. I'll merge when tests are passing. |
This PR fixes a log error for rewrite parameter max-file-size-bytes, when I set the target-file-size-bytes less than max-file-size-bytes, spark throwed a checkAgument exception "Cannot set max-file-size-bytes is greater than or equal to target-file-size-bytes, all files written will be larger than the threshold", it's puzzling, so I fix this error.