Jibing-Li commented on code in PR #38990: URL: https://github.com/apache/doris/pull/38990#discussion_r1708508535
########## fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalRowCountCache.java: ########## @@ -86,56 +86,50 @@ protected Optional<Long> doLoad(RowCountKey rowCountKey) { 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); - return Optional.empty(); + LOG.warn("Failed to get table row count with catalogId {}, dbId {}, tableId {}. Reason {}", + rowCountKey.catalogId, rowCountKey.dbId, rowCountKey.tableId, e.getMessage()); + LOG.debug(e); + return null; Review Comment: added ########## fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergUtils.java: ########## @@ -592,22 +592,17 @@ public static List<Column> getSchema(ExternalCatalog catalog, String dbName, Str * @return estimated row count */ public static long getIcebergRowCount(ExternalCatalog catalog, String dbName, String tbName) { - try { - Table icebergTable = Env.getCurrentEnv() - .getExtMetaCacheMgr() - .getIcebergMetadataCache() - .getIcebergTable(catalog, dbName, tbName); - Snapshot snapshot = icebergTable.currentSnapshot(); - if (snapshot == null) { - // empty table - return 0; - } - Map<String, String> summary = snapshot.summary(); - return Long.parseLong(summary.get(TOTAL_RECORDS)) - Long.parseLong(summary.get(TOTAL_POSITION_DELETES)); - } catch (Exception e) { - LOG.warn("Fail to collect row count for db {} table {}", dbName, tbName, e); + Table icebergTable = Env.getCurrentEnv() + .getExtMetaCacheMgr() + .getIcebergMetadataCache() + .getIcebergTable(catalog, dbName, tbName); + Snapshot snapshot = icebergTable.currentSnapshot(); Review Comment: added -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org