Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/13919#discussion_r69081332
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala
---
@@ -351,11 +352,23 @@ class JDBCSuite extends SparkFunSuite
urlWithUserAndPass, "TEST.PEOPLE", new Properties).collect().length
=== 3)
}
- test("Basic API with FetchSize") {
+ test("Basic API with illegal FetchSize") {
val properties = new Properties
- properties.setProperty("fetchSize", "2")
- assert(spark.read.jdbc(
- urlWithUserAndPass, "TEST.PEOPLE", properties).collect().length ===
3)
+ properties.setProperty(JdbcUtils.JDBC_BATCH_FETCH_SIZE, "-1")
+ val e = intercept[SparkException] {
+ spark.read.jdbc(urlWithUserAndPass, "TEST.PEOPLE",
properties).collect()
+ }.getMessage
+ assert(e.contains("Invalid value `-1` for parameter `fetchsize`. The
minimum value is zero. " +
+ "When the value is zero, the JDBC driver ignores the value and does
the estimates."))
+ }
+
+ test("Basic API with FetchSize") {
+ (0 to 4).foreach { size =>
+ val properties = new Properties
--- End diff --
I see. Will make a change.
---
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]