e6dc5f2807
In order to enable truncate for PostgreSQL databases in Spark JDBC, a change is needed to the query used for truncating a PostgreSQL table. By default, PostgreSQL will automatically truncate any descendant tables if a TRUNCATE query is executed. As this may result in (unwanted) side-effects, the query used for the truncate should be specified separately for PostgreSQL, specifying only to TRUNCATE a single table. ## What changes were proposed in this pull request? Add `getTruncateQuery` function to `JdbcDialect.scala`, with default query. Overridden this function for PostgreSQL to only truncate a single table. Also sets `isCascadingTruncateTable` to false, as this will allow truncates for PostgreSQL. ## How was this patch tested? Existing tests all pass. Added test for `getTruncateQuery` Author: Daniel van der Ende <daniel.vanderende@gmail.com> Closes #19911 from danielvdende/SPARK-22717. |
||
---|---|---|
.. | ||
benchmarks | ||
src | ||
pom.xml |