GitHub user LucaCanali opened a pull request:
https://github.com/apache/spark/pull/18724
[SPARK-21519][SQL] Add an option to the JDBC data source to initialize the
target DB environment
Add an option to the JDBC data source to initialize the environment of the
remote database session
## What changes were proposed in this pull request?
This proposes an option to the JDBC datasource, tentatively called "
sessionInitStatement" to implement the functionality of session initialization
present for example in the Sqoop connector for Oracle (see
https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#_oraoop_oracle_session_initialization_statements
) . After each database session is opened to the remote DB, and before
starting to read data, this option executes a custom SQL statement (or a PL/SQL
block in the case of Oracle).
See also https://issues.apache.org/jira/browse/SPARK-21519
## How was this patch tested?
Manually tested using Spark SQL data source and Oracle JDBC
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/LucaCanali/spark
JDBC_datasource_sessionInitStatement
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/18724.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 #18724
----
commit 92d082a67910bd7e5f3aeefc204f97a60f144e08
Author: LucaCanali <[email protected]>
Date: 2017-07-24T08:46:17Z
Add an option to the JDBC data source to initialize the environment of the
remote database session
----
---
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]