-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-12340][SQL] Fix overstep the bounds of Int in SparkPlan.executeTake #10310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Modifies partsScanned to partsScanned.toLong and chang result of math.min to Int.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
|
Test build #2217 has finished for PR 10310 at commit
|
partsScanned maybe overstep the bounds of Int If partsScanned = 1 and numPartsToTry = Int.MaxValue, partsScanned += numPartsToTry well be Int.MinValue. So we chang to use the size of seq p.
|
The number of partitions which has scanned is the size of seq p, not numPartsToTry. So I use p.size to instead of numPartsToTry in line partsScanned += numPartsToTry |
|
Yes I think that also makes sense, in the case where we hit the limit of |
|
Test build #2220 has finished for PR 10310 at commit
|
|
Can you also change take in RDD? |
|
I think it (take in RDD) is ok. |
|
@QiangCai I think that technically |
|
@srowen I have modified all the code, and try to keep them to be the same. At first, the var numPartsToTry and partsScanned have been set to Long. |
|
@QiangCai thanks that looks good, but this needs a rebase now. |
|
@srowen I maybe have made a mistake in git bash. Can I new another pull request to resolve this problem? |
|
I think you just need to rebase from master and force-push the result, but do what you need to. |
If partsScanned = 1, numPartsToTry = Int.MaxValue and totalParts = 200, the result of math.min(partsScanned + numPartsToTry, totalParts) will be Int.MinValue (-2147483648).
Modifies partsScanned to partsScanned.toLong and chang result of math.min to Int.
https://issues.apache.org/jira/browse/SPARK-12340