GitHub user rtreffer opened a pull request:
https://github.com/apache/spark/pull/5555
[SPARK-6888][SQL] Make the jdbc driver handling user-definable
Replace the DriverQuirks with JdbcDialect(s) (and
MySQLDialect/PostgresDialect)
and allow developers to change the dialects on the fly (for new JDBCRRDs
only).
Some types (like an unsigned 64bit number) can be trivially mapped to java.
The status quo is that the RRD will fail to load.
This patch makes it possible to overwrite the type mapping to read e.g.
64Bit numbers as strings and handle them afterwards in software.
JDBCSuite has an example that maps all types to String, which should always
work (at the cost of extra code afterwards).
As a side effect it should now be possible to develop simple dialects
out-of-tree and even with spark-shell.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rtreffer/spark jdbc-dialects
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/5555.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 #5555
----
commit 3e98f746a90a4764647fb9f4b17a416cab3f868a
Author: Rene Treffer <[email protected]>
Date: 2015-04-17T09:06:55Z
[SPARK-6888] Make the jdbc driver handling user-definable
Replace the DriverQuirks with JdbcDialect(s) (and
MySQLDialect/PostgresDialect)
and allow developers to change the dialects on the fly (for new JDBCRRDs
only).
Some types (like an unsigned 64bit number) can be trivially mapped to java.
The status quo is that the RRD will fail to load.
This patch makes it possible to overwrite the type mapping to read e.g.
64Bit numbers as strings and handle them afterwards in software.
JDBCSuite has an example that maps all types to String, which should always
work (at the cost of extra code afterwards).
As a side effect it should now be possible to develop simple dialects
out-of-tree and even with spark-shell.
----
---
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]