You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by li...@apache.org on 2024/01/24 14:04:03 UTC
(doris) branch branch-2.0 updated: [improvement](statistics)Catch load column stats exception, avoid print too much stack info to fe.out #30315 (#30330)
This is an automated email from the ASF dual-hosted git repository.
lijibing pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 0e0bff35811 [improvement](statistics)Catch load column stats exception, avoid print too much stack info to fe.out #30315 (#30330)
0e0bff35811 is described below
commit 0e0bff35811da9869e89189bf05abfb37ae394d4
Author: Jibing-Li <64...@users.noreply.github.com>
AuthorDate: Wed Jan 24 22:03:55 2024 +0800
[improvement](statistics)Catch load column stats exception, avoid print too much stack info to fe.out #30315 (#30330)
---
.../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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org