Skip to content

Commit 4a957e4

Browse files
committed
Add assert.
1 parent f9db374 commit 4a957e4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ class JdbcRelationProvider extends CreatableRelationProvider
3535
val upperBound = jdbcOptions.upperBound
3636
val numPartitions = jdbcOptions.numPartitions
3737

38-
val partitionInfo = if (partitionColumn.isEmpty || lowerBound.isEmpty || upperBound.isEmpty ||
39-
numPartitions.isEmpty) {
38+
val partitionInfo = if (partitionColumn.isEmpty) {
39+
assert(lowerBound.isEmpty && upperBound.isEmpty)
4040
null
4141
} else {
42+
assert(lowerBound.nonEmpty && upperBound.nonEmpty && numPartitions.nonEmpty)
4243
JDBCPartitioningInfo(
4344
partitionColumn.get, lowerBound.get, upperBound.get, numPartitions.get)
4445
}

0 commit comments

Comments
 (0)