Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ class JDBCOptions(
s" and '$JDBC_NUM_PARTITIONS' are required.")
val fetchSize = {
val size = parameters.getOrElse(JDBC_BATCH_FETCH_SIZE, "0").toInt
require(size >= 0,
require(size >= 0 || size == Integer.MIN_VALUE,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not make sense to the other data sources except MySQL. If needed, we can introduce a dialect specific checking APIs in JdbcDialect.scala

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for @gatorsmile 's suggestion.

s"Invalid value `${size.toString}` for parameter " +
s"`$JDBC_BATCH_FETCH_SIZE`. The minimum value is 0. When the value is 0, " +
"the JDBC driver ignores the value and does the estimates.")
s"`$JDBC_BATCH_FETCH_SIZE`. The value should be >= 0 or equal Integer.MIN_VALUE. " +
"When the value is 0, the JDBC driver ignores the value and does the estimates. " +
"When the value is Integer.MIN_VALUE then result will be retrieved row-by-row.")
size
}

Expand Down