spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gatorsmile <...@git.apache.org>
Subject [GitHub] spark pull request #19888: [SPARK-22686][SQL] DROP TABLE IF EXISTS should no...
Date Tue, 05 Dec 2017 05:49:39 GMT
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19888#discussion_r154852162
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala ---
    @@ -206,7 +206,8 @@ case class DropTableCommand(
         try {
           sparkSession.sharedState.cacheManager.uncacheQuery(sparkSession.table(tableName))
         } catch {
    -      case _: NoSuchTableException if ifExists =>
    +      case ae: AnalysisException
    +        if ifExists && ae.cause.nonEmpty && ae.getCause.isInstanceOf[NoSuchTableException]
=>
    --- End diff --
    
    ```
    scala> spark.version
    res2: String = 2.3.0-SNAPSHOT
    
    scala> sql("DROP TABLE IF EXISTS t")
    res3: org.apache.spark.sql.DataFrame = []
    
    scala> sql("DROP TABLE IF EXISTS t")
    res4: org.apache.spark.sql.DataFrame = []
    ```
    
    Unable to reproduce it.


---

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


Mime
View raw message