Zouxxyy commented on code in PR #4863:
URL: https://github.com/apache/paimon/pull/4863#discussion_r1906826650


##########
paimon-core/src/main/java/org/apache/paimon/catalog/AbstractCatalog.java:
##########
@@ -272,10 +272,14 @@ public void dropTable(Identifier identifier, boolean 
ignoreIfNotExists)
         try {
             getTable(identifier);
         } catch (TableNotExistException e) {
+            if (!tableExistsInFileSystem(getTableLocation(identifier), 
DEFAULT_MAIN_BRANCH)) {

Review Comment:
   As far as I know, before Spark calls `catalog.dropTable`, it actually 
invokes `catalog.getTable` fisrtly. It has already been skipped there.
   
   ```scala
   case class DropTableExec(
       catalog: TableCatalog,
       ident: Identifier,
       ifExists: Boolean,
       purge: Boolean,
       invalidateCache: () => Unit) extends LeafV2CommandExec {
   
     override def run(): Seq[InternalRow] = {
       if (catalog.tableExists(ident)) {
         invalidateCache()
         if (purge) catalog.purgeTable(ident) else catalog.dropTable(ident)
       } else if (!ifExists) {
         throw QueryCompilationErrors.noSuchTableError(
           catalog.name() +: ident.namespace() :+ ident.name())
       }
   
       Seq.empty
     }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to