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

Support `truncate` option in Overwrite mode for JDBC DataFrameWriter

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.1.0
    • SQL
    • None

    Description

      This issue adds a boolean option, `truncate`, for SaveMode.Overwrite of JDBC DataFrameWriter. If this option is `true`, it use `TRUNCATE TABLE` instead of `DROP TABLE`.

      • Without CREATE/DROP privilege, we can save dataframe to database. Sometime these are not allowed for security.
      • It will keep the existing table information, so users can add and keep some additional CONSTRAINTs for the table.
      • Sometime, TRUNCATE is faster than the combination of DROP/CREATE.

      This issue is different from SPARK-16410 which aims to use `TRUNCATE` only for JDBC sources.

      Attachments

        Issue Links

          Activity

            People

              dongjoon Dongjoon Hyun
              dongjoon Dongjoon Hyun
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: