This is an automated email from the ASF dual-hosted git repository.

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit e7676223df4861992e10cfcea727002fcfca73e9
Author: Eyizoha <[email protected]>
AuthorDate: Thu Jul 17 17:42:51 2025 +0800

    IMPALA-14233: Fix unexpected Kudu table drop attempt on external table 
creation failure
    
    The existing code incorrectly attempts to drop the corresponding
    Kudu table when the creation of a Kudu external table in HMS fails due
    to an erroneous negation in the if condition (fortunately, there are
    additional checks with Preconditions in KuduCatalogOpExecutor.dropTable,
    causing such attempts to always fail). Additionally, when creating a
    Kudu synchronized table, if the table creation fails in HMS, it will
    unexpectedly skip deleting the corresponding Kudu table, resulting in an
    "already exists in Kudu" error when retrying the table creation.
    
    Removed the incorrect negation in the if condition to align with the
    intended behavior described in the comment.
    
    Testing:
     - Existing tests cover this change.
    
    Change-Id: I67d1cb333526fa41f247757997a6f7cf60d26c0b
    Reviewed-on: http://gerrit.cloudera.org:8080/23181
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java 
b/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
index adb8fe360..4814403f4 100644
--- a/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
+++ b/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
@@ -4043,7 +4043,7 @@ public class CatalogOpExecutor {
     } catch (Exception e) {
       try {
         // Error creating the table in HMS, drop the synchronized table from 
Kudu.
-        if (!KuduTable.isSynchronizedTable(newTable)) {
+        if (KuduTable.isSynchronizedTable(newTable)) {
           KuduCatalogOpExecutor.dropTable(newTable, /* if exists */ false,
               /* kudu_table_reserve_seconds */ 0, catalogTimeline);
         }

Reply via email to