[Enhancement] Optimize logging error message for delta lake (backport #63389) (#63431)

Co-authored-by: Youngwb <yangwenbo_mailbox@163.com>
This commit is contained in:
mergify[bot] 2025-09-23 09:20:15 +00:00 committed by GitHub
parent f6ab8e8b94
commit 7f0a2acad5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 4 deletions

View File

@ -142,11 +142,15 @@ public abstract class DeltaLakeMetastore implements IDeltaLakeMetastore {
Table deltaTable = Table.forPath(deltaLakeEngine, path);
snapshot = (SnapshotImpl) deltaTable.getLatestSnapshot(deltaLakeEngine);
} catch (TableNotFoundException e) {
LOG.error("Failed to find Delta table for {}.{}.{}, {}", catalogName, dbName, tableName, e.getMessage());
throw new SemanticException("Failed to find Delta table for " + catalogName + "." + dbName + "." + tableName);
LOG.error("Failed to find Delta table for {}.{}.{}, {}. caused by : {}", catalogName, dbName, tableName,
e.getMessage(), e.getCause());
throw new SemanticException("Failed to find Delta table for %s.%s.%s, %s. caused by : %s", catalogName,
dbName, tableName, e.getMessage(), e.getCause());
} catch (Exception e) {
LOG.error("Failed to get latest snapshot for {}.{}.{}, {}", catalogName, dbName, tableName, e.getMessage());
throw new SemanticException("Failed to get latest snapshot for " + catalogName + "." + dbName + "." + tableName);
LOG.error("Failed to get latest snapshot for {}.{}.{}, {}. caused by : {}", catalogName, dbName,
tableName, e.getMessage(), e.getCause());
throw new SemanticException("Failed to get latest snapshot for %s.%s.%s, %s. caused by : %s",
catalogName, dbName, tableName, e.getMessage(), e.getCause());
}
return new DeltaLakeSnapshot(dbName, tableName, deltaLakeEngine, snapshot, metastoreTable);
}