[fix](statistics)Fix external table show column stats type bug (#26910)

The show column stats result for external table shows N/A for the columns of method, type, trigger and query_times. This pr is to fix this bug, to show the correct value.
This commit is contained in:
Jibing-Li
2023-11-14 14:47:05 +08:00
committed by GitHub
parent 23e2bded1a
commit cd25579bdf
2 changed files with 48 additions and 3 deletions

View File

@ -340,6 +340,7 @@ public class AnalysisManager implements Writable {
constructJob(jobInfo, analysisTaskInfos.values());
if (isSync) {
syncExecute(analysisTaskInfos.values());
jobInfo.state = AnalysisState.FINISHED;
updateTableStats(jobInfo);
return null;
}
@ -593,8 +594,9 @@ public class AnalysisManager implements Writable {
public void updateTableStats(AnalysisInfo jobInfo) {
TableIf tbl = StatisticsUtil.findTable(jobInfo.catalogId,
jobInfo.dbId, jobInfo.tblId);
// External Table update table stats after table level task finished.
if (tbl instanceof ExternalTable) {
// External Table only update table stats when all tasks finished.
// Because it needs to get the row count from the result of row count task.
if (tbl instanceof ExternalTable && !jobInfo.state.equals(AnalysisState.FINISHED)) {
return;
}
TableStatsMeta tableStats = findTableStatsStatus(tbl.getId());