Github user dongjoon-hyun commented on the issue:
https://github.com/apache/spark/pull/14086
Now, the PR have a ability to allow `truncate` option only if `TRUNCATE
TABLE` default is not cascading. For the unknown or
known-to-be-cascading-default DBMS (Postgres), `truncate` option is ignored.
Spark Dialects | CASCADING TRUNCATE DEFAULT | `truncate` OPTION SUPPORT
---------------|-----------------------------------|-------------------------------
MySQLDialect | X | O
PostgresDialect | O | X
DB2Dialect | X | O
MsSqlServerDialect | X | O
DerbyDialect | X | O
OracleDialect | X | O
H2Dialect | X | O
During searching, I found this [DBMS
Comparison](http://www.sql-workbench.net/dbms_comparison.html) (Last updated:
2016-05-16)
It looks consistent with each DBMS's docs. Please note that the approach of
this PR gives two steps of choice for users.
- First step, users can choose `truncate` option for their own risk.
- Second step, although the `truncate` option is true, we do not use
`TRUNCATE TABLE` for unknown DBMSs or known-to-be-different DBMS.
Always, the fallback operation is the existing `DROP TABLE`.
---
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]