Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/15292#discussion_r81592961
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala
---
@@ -45,19 +65,48 @@ class JDBCOptions(
val upperBound = parameters.getOrElse("upperBound", null)
// the number of partitions
val numPartitions = parameters.getOrElse("numPartitions", null)
-
require(partitionColumn == null ||
(lowerBound != null && upperBound != null && numPartitions != null),
"If 'partitionColumn' is specified then 'lowerBound', 'upperBound'," +
" and 'numPartitions' are required.")
+ val fetchSize = {
+ val size = parameters.getOrElse(JDBC_BATCH_FETCH_SIZE, "0").toInt
+ require(size >= 0,
+ 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.")
+ size
+ }
// ------------------------------------------------------------
- // The options for DataFrameWriter
--- End diff --
+1
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]