GitHub user wangyum opened a pull request:
https://github.com/apache/spark/pull/14377
[SPARK-16625][SQL] General data types to be mapped to Oracle
## What changes were proposed in this pull request?
Spark will convert **BooleanType** to **BIT(1)**, **LongType** to
**BIGINT**, **ByteType** to **BYTE** when saving DataFrame to Oracle, but
Oracle does not support BIT, BIGINT and BYTE types.
This PR is convert following _Spark Types_ to _Oracle types_ refer to
[Oracle Developer's Guide](https://docs.oracle.com/cd/E19501-01/819-3659/gcmaz/)
Spark Type | Oracle
----|----
BooleanType | NUMBER(1)
IntegerType | NUMBER(10)
LongType | NUMBER(19)
FloatType | NUMBER(19, 4)
DoubleType | NUMBER(19, 4)
ByteType | NUMBER(3)
ShortType | NUMBER(5)
## How was this patch tested?
Add new tests in
[JDBCSuite.scala](https://github.com/wangyum/spark/commit/22b0c2a4228cb8b5098ad741ddf4d1904e745ff6#diff-dc4b58851b084b274df6fe6b189db84d)
and
[OracleDialect.scala](https://github.com/wangyum/spark/commit/22b0c2a4228cb8b5098ad741ddf4d1904e745ff6#diff-5e0cadf526662f9281aa26315b3750ad)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/wangyum/spark SPARK-16625
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14377.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #14377
----
commit 22b0c2a4228cb8b5098ad741ddf4d1904e745ff6
Author: Yuming Wang <[email protected]>
Date: 2016-07-27T06:33:10Z
General data types to be mapped to Oracle
----
---
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]