From 97b6d7bc74b1895db0c772b4c0de726c6be2c3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bry=C5=84ski?= Date: Mon, 3 Jul 2017 14:46:29 +0200 Subject: [PATCH] Update JDBCOptions.scala --- .../spark/sql/execution/datasources/jdbc/JDBCOptions.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala index 591096d5efd22..2b81923f94118 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala @@ -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, 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 }