diff options
author | gatorsmile <gatorsmile@gmail.com> | 2016-07-01 09:54:02 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-07-01 09:54:02 +0100 |
commit | 0ad6ce7e54b1d8f5946dde652fa5341d15059158 (patch) | |
tree | f945df79c6f34f9c5335b75607cc0896e1c76305 /R/pkg/inst/tests | |
parent | 66283ee0b25de2a5daaa21d50a05a7fadec1de77 (diff) | |
download | spark-0ad6ce7e54b1d8f5946dde652fa5341d15059158.tar.gz spark-0ad6ce7e54b1d8f5946dde652fa5341d15059158.tar.bz2 spark-0ad6ce7e54b1d8f5946dde652fa5341d15059158.zip |
[SPARK-16222][SQL] JDBC Sources - Handling illegal input values for `fetchsize` and `batchsize`
#### What changes were proposed in this pull request?
For JDBC data sources, users can specify `batchsize` for multi-row inserts and `fetchsize` for multi-row fetch. A few issues exist:
- The property keys are case sensitive. Thus, the existing test cases for `fetchsize` use incorrect names, `fetchSize`. Basically, the test cases are broken.
- No test case exists for `batchsize`.
- We do not detect the illegal input values for `fetchsize` and `batchsize`.
For example, when `batchsize` is zero, we got the following exception:
```
Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0, localhost): java.lang.ArithmeticException: / by zero
```
when `fetchsize` is less than zero, we got the exception from the underlying JDBC driver:
```
Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0, localhost): org.h2.jdbc.JdbcSQLException: Invalid value "-1" for parameter "rows" [90008-183]
```
This PR fixes all the above issues, and issue the appropriate exceptions when detecting the illegal inputs for `fetchsize` and `batchsize`. Also update the function descriptions.
#### How was this patch tested?
Test cases are fixed and added.
Author: gatorsmile <gatorsmile@gmail.com>
Closes #13919 from gatorsmile/jdbcProperties.
Diffstat (limited to 'R/pkg/inst/tests')
0 files changed, 0 insertions, 0 deletions