GitHub user danielvdende opened a pull request:
https://github.com/apache/spark/pull/20057
[SPARK-22880][SQL] Add cascadeTruncate option to JDBC datasource
This commit adds the `cascadeTruncate` option to the JDBC datasource
API, for databases that support this functionality (PostgreSQL and
Oracle at the moment). This allows for applying a cascading truncate
that affects tables that have foreign key constraints on the table
being truncated.
## What changes were proposed in this pull request?
Add `cascadeTruncate` option to JDBC datasource API. Allow this to affect
the
`TRUNCATE` query for databases that support this option.
## How was this patch tested?
Existing tests for `truncateQuery` were updated. Also, an additional test
was added
to ensure that the correct syntax was applied, and that enabling the config
for databases
that do not support this option does not result in invalid queries.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/danielvdende/spark SPARK-22880
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/20057.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 #20057
----
commit 842eca7fa282a81f0f4d459242869c022ef21080
Author: Daniel van der Ende <daniel.vanderende@...>
Date: 2017-12-22T15:58:28Z
[SPARK-22880][SQL] Add cascadeTruncate option to JDBC datasource
This commit adds the cascadeTruncate option to the JDBC datasource
API, for databases that support this functionality (PostgreSQL and
Oracle at the moment). This allows for applying a cascading truncate
that affects tables that have foreign key constraints on the table
being truncated.
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]