morningman commented on code in PR #20906:
URL: https://github.com/apache/doris/pull/20906#discussion_r1232368298


##########
fe/fe-core/src/main/java/org/apache/doris/statistics/ColumnStatisticsCacheLoader.java:
##########
@@ -42,20 +43,38 @@ public class ColumnStatisticsCacheLoader extends 
StatisticsCacheLoader<Optional<
 
     @Override
     protected Optional<ColumnStatistic> doLoad(StatisticsCacheKey key) {
+        // Load from statistics table.
+        Optional<ColumnStatistic> columnStatistic = 
loadFromStatsTable(String.valueOf(key.tableId),
+                String.valueOf(key.idxId), key.colName);
+        if (columnStatistic.isPresent()) {
+            return columnStatistic;
+        }
+        // Load from data source metadata
+        try {
+            TableIf table = 
Env.getCurrentEnv().getCatalogMgr().getCatalog(key.catalogId)
+                    
.getDbOrMetaException(key.dbId).getTableOrMetaException(key.tableId);
+            columnStatistic = table.getColumnStatistic();
+        } catch (Exception e) {
+            LOG.warn("Exception to get column statistics by metadata.", e);

Review Comment:
   better print catalog,db,table info



##########
fe/fe-common/src/main/java/org/apache/doris/common/Config.java:
##########
@@ -1753,7 +1753,7 @@ public class Config extends ConfigBase {
      * Otherwise, use external catalog metadata.
      */
     @ConfField(mutable = true)
-    public static boolean collect_external_table_stats_by_sql = false;
+    public static boolean collect_external_table_stats_by_sql = true;

Review Comment:
   How about just remove this config?



-- 
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

Reply via email to