morrySnow commented on code in PR #38990:
URL: https://github.com/apache/doris/pull/38990#discussion_r1706961694
##########
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:
add this explanation to comment?
##########
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:
To add this explanation to a comment?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]