This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 63cf2777f97773ae4fe28c49325cd365568ce2b6 Author: Jibing-Li <[email protected]> AuthorDate: Wed Jan 24 18:09:25 2024 +0800 [improvement](statistics)Catch load column stats exception, avoid print too much stack info to fe.out #30315 --- .../statistics/ColumnStatisticsCacheLoader.java | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatisticsCacheLoader.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatisticsCacheLoader.java index 08a410b8599..eda3645fd00 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatisticsCacheLoader.java +++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatisticsCacheLoader.java @@ -42,18 +42,25 @@ public class ColumnStatisticsCacheLoader extends StatisticsCacheLoader<Optional< @Override protected Optional<ColumnStatistic> doLoad(StatisticsCacheKey key) { - // Load from statistics table. - Optional<ColumnStatistic> columnStatistic = loadFromStatsTable(key); - if (columnStatistic.isPresent()) { - return columnStatistic; - } - // Load from data source metadata + Optional<ColumnStatistic> columnStatistic = Optional.empty(); try { - TableIf table = StatisticsUtil.findTable(key.catalogId, key.dbId, key.tableId); - columnStatistic = table.getColumnStatistic(key.colName); - } catch (Exception e) { - LOG.debug(String.format("Exception to get column statistics by metadata. [Catalog:%d, DB:%d, Table:%d]", - key.catalogId, key.dbId, key.tableId), e); + // Load from statistics table. + columnStatistic = loadFromStatsTable(key); + if (columnStatistic.isPresent()) { + return columnStatistic; + } + // Load from data source metadata + try { + TableIf table = StatisticsUtil.findTable(key.catalogId, key.dbId, key.tableId); + columnStatistic = table.getColumnStatistic(key.colName); + } catch (Exception e) { + LOG.debug(String.format("Exception to get column statistics by metadata. [Catalog:{}, DB:{}, Table:{}]", + key.catalogId, key.dbId, key.tableId), e); + } + } catch (Throwable t) { + LOG.warn("Failed to load stats for column [Catalog:{}, DB:{}, Table:{}, Column:{}], Reason: {}", + key.catalogId, key.dbId, key.tableId, key.colName, t.getMessage()); + LOG.debug(t); } return columnStatistic; } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
