Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20057#discussion_r168882930
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
 ---
    @@ -102,7 +102,12 @@ object JdbcUtils extends Logging {
         val dialect = JdbcDialects.get(options.url)
         val statement = conn.createStatement
         try {
    -      statement.executeUpdate(dialect.getTruncateQuery(options.table))
    +      if (options.isCascadeTruncate.isDefined) {
    +        statement.executeUpdate(dialect.getTruncateQuery(options.table,
    +          options.isCascadeTruncate))
    +      } else {
    +        statement.executeUpdate(dialect.getTruncateQuery(options.table))
    +      }
    --- End diff --
    
    Simply, one line if we are using `boolean` instead of `Option`?
    ```
    statement.executeUpdate(dialect.getTruncateQuery(options.table, 
options.isCascadeTruncate))
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to