-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-21330][SQL] Bad partitioning does not allow to read a JDBC table with extreme values on the partition column #18800
Conversation
@@ -64,7 +64,8 @@ private[sql] object JDBCRelation extends Logging { | |||
s"bound. Lower bound: $lowerBound; Upper bound: $upperBound") | |||
|
|||
val numPartitions = | |||
if ((upperBound - lowerBound) >= partitioning.numPartitions) { | |||
if ((upperBound - lowerBound) >= partitioning.numPartitions || | |||
(upperBound - lowerBound) < 0) { |
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.
Looks good. for bonus points, add a comment about what this is for, and indent this line two more spaces
val df = sql("SELECT * FROM partsoverflow") | ||
checkNumPartitions(df, expectedNumPartitions = 3) | ||
assert(df.collect().length == 3) | ||
|
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.
And maybe delete this blank for tidiness
Test build #80130 has finished for PR 18800 at commit
|
Test build #80131 has finished for PR 18800 at commit
|
Test build #3867 has finished for PR 18800 at commit
|
…le with extreme values on the partition column ## What changes were proposed in this pull request? An overflow of the difference of bounds on the partitioning column leads to no data being read. This patch checks for this overflow. ## How was this patch tested? New unit test. Author: Andrew Ray <ray.andrew@gmail.com> Closes #18800 from aray/SPARK-21330. (cherry picked from commit 25826c7) Signed-off-by: Sean Owen <sowen@cloudera.com>
…le with extreme values on the partition column ## What changes were proposed in this pull request? An overflow of the difference of bounds on the partitioning column leads to no data being read. This patch checks for this overflow. ## How was this patch tested? New unit test. Author: Andrew Ray <ray.andrew@gmail.com> Closes #18800 from aray/SPARK-21330. (cherry picked from commit 25826c7) Signed-off-by: Sean Owen <sowen@cloudera.com>
Merged to master/2.2/2.1 |
…le with extreme values on the partition column ## What changes were proposed in this pull request? An overflow of the difference of bounds on the partitioning column leads to no data being read. This patch checks for this overflow. ## How was this patch tested? New unit test. Author: Andrew Ray <ray.andrew@gmail.com> Closes apache#18800 from aray/SPARK-21330. (cherry picked from commit 25826c7) Signed-off-by: Sean Owen <sowen@cloudera.com>
…le with extreme values on the partition column An overflow of the difference of bounds on the partitioning column leads to no data being read. This patch checks for this overflow. New unit test. Author: Andrew Ray <ray.andrew@gmail.com> Closes apache#18800 from aray/SPARK-21330. (cherry picked from commit 25826c7) Signed-off-by: Sean Owen <sowen@cloudera.com>
What changes were proposed in this pull request?
An overflow of the difference of bounds on the partitioning column leads to no data being read. This
patch checks for this overflow.
How was this patch tested?
New unit test.