Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-22729

Add getTruncateQuery to JdbcDialect

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.3.0
    • Component/s: SQL
    • Labels:
      None
    • Target Version/s:

      Description

      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.

      This will also resolve SPARK-22717

      See PostgreSQL documentation https://www.postgresql.org/docs/current/static/sql-truncate.html

      This change will still not let users truncate a table with cascade enabled (which would also truncate tables with foreign key constraints to the table).

        Attachments

          Activity

            People

            • Assignee:
              danielvdende Daniel van der Ende
              Reporter:
              danielvdende Daniel van der Ende
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: