weizhengte commented on code in PR #8860:
URL: https://github.com/apache/incubator-doris/pull/8860#discussion_r844848175


##########
fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsManager.java:
##########
@@ -133,7 +139,25 @@ private Table validateTableName(TableName dbTableName) 
throws AnalysisException
         String tableName = dbTableName.getTbl();
 
         Database db = 
Catalog.getCurrentCatalog().getDbOrAnalysisException(dbName);
-        Table table = db.getTableOrAnalysisException(tableName);
-        return table;
+        return db.getTableOrAnalysisException(tableName);
+    }
+
+    public void alterTableStatistics(StatisticsTaskResult taskResult) throws 
AnalysisException {
+        StatsGranularityDesc desc = taskResult.getGranularityDesc();
+        long tableId = desc.getTableId();
+        Map<String, String> statsNameToValue = 
taskResult.getStatsNameToValue();
+        this.statistics.updateTableStats(tableId, statsNameToValue);
+    }
+
+    public void alterColumnStatistics(StatisticsTaskResult taskResult) throws 
AnalysisException {
+        StatsCategoryDesc categoryDesc = taskResult.getCategoryDesc();
+        long dbId = categoryDesc.getDbId();
+        long tableId = categoryDesc.getTableId();
+        Database db = 
Catalog.getCurrentCatalog().getDbOrAnalysisException(dbId);
+        Table table = db.getTableOrAnalysisException(tableId);
+        String columnName = categoryDesc.getColumnName();
+        Type columnType = table.getColumn(columnName).getType();
+        Map<String, String> statsNameToValue = 
taskResult.getStatsNameToValue();
+        this.statistics.updateColumnStats(tableId, columnName, columnType, 
statsNameToValue);

Review Comment:
   same as above~



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