branch-2.1: [improve](hive row count)Log stack info when fetch hive row count fail. (#52795) (#52849)

backport: https://github.com/apache/doris/pull/52795
This commit is contained in:
James
2025-07-09 09:57:24 +08:00
committed by GitHub
parent 3dde6775a9
commit abb9c88a3f

View File

@ -86,8 +86,13 @@ public class ExternalRowCountCache {
TableIf table = StatisticsUtil.findTable(rowCountKey.catalogId, rowCountKey.dbId, rowCountKey.tableId);
return Optional.of(table.fetchRowCount());
} catch (Exception e) {
LOG.warn("Failed to get table with catalogId {}, dbId {}, tableId {}", rowCountKey.catalogId,
rowCountKey.dbId, rowCountKey.tableId);
String message = String.format("Failed to get table with catalogId %s, dbId %s, tableId %s. Reason: %s",
rowCountKey.catalogId, rowCountKey.dbId, rowCountKey.tableId, e.getMessage());
if (LOG.isDebugEnabled()) {
LOG.debug(message, e);
} else {
LOG.warn(message);
}
return Optional.empty();
}
}