You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "morningman (via GitHub)" <gi...@apache.org> on 2023/06/16 15:00:53 UTC

[GitHub] [doris] morningman commented on a diff in pull request #20906: [Improvement](multi catalog, statistics)Support two level external statistics cache loader.

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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org