Github user klinvill commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20057#discussion_r169526767
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/jdbc/TeradataDialect.scala ---
    @@ -31,4 +31,19 @@ private case object TeradataDialect extends JdbcDialect {
         case BooleanType => Option(JdbcType("CHAR(1)", java.sql.Types.CHAR))
         case _ => None
       }
    +
    +  override def isCascadingTruncateTable(): Option[Boolean] = Some(false)
    +
    +  /**
    +   * The SQL query used to truncate a table.
    +   * @param table The table to truncate.
    +   * @param cascade Whether or not to cascade the truncation. Default 
value is the
    +   *                value of isCascadingTruncateTable(). Ignored for 
Teradata as it is unsupported
    +   * @return The SQL query to use for truncating a table
    +   */
    +  override def getTruncateQuery(
    +      table: String,
    +      cascade: Option[Boolean] = isCascadingTruncateTable): String = {
    +    s"TRUNCATE TABLE $table"
    --- End diff --
    
    Hi @dongjoon-hyun, I was the original author of the TeradataDialect and 
@gatorsmile reviewed and committed it. You are correct, Teradata does not 
support the TRUNCATE statement. Instead Teradata uses a DELETE statement so you 
should be able to use `DELETE FROM $table ALL` instead of `TRUNCATE TABLE 
$table`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to