Skip to content

Commit 9587bf1

Browse files
committed
address pr comments
1 parent 7de8ccc commit 9587bf1

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCRelation.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ private[sql] object JDBCRelation extends Logging {
6464
s"bound. Lower bound: $lowerBound; Upper bound: $upperBound")
6565

6666
val numPartitions =
67-
if ((upperBound - lowerBound) >= partitioning.numPartitions ||
68-
(upperBound - lowerBound) < 0) {
67+
if ((upperBound - lowerBound) >= partitioning.numPartitions || /* check for overflow */
68+
(upperBound - lowerBound) < 0) {
6969
partitioning.numPartitions
7070
} else {
7171
logWarning("The number of partitions is reduced because the specified number of " +

sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ class JDBCSuite extends SparkFunSuite
389389
val df = sql("SELECT * FROM partsoverflow")
390390
checkNumPartitions(df, expectedNumPartitions = 3)
391391
assert(df.collect().length == 3)
392-
393392
}
394393

395394
test("Register JDBC query with renamed fields") {

0 commit comments

Comments
 (0)