Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,9 @@ private void transferToNonMaster(FrontendNodeType newType) {

// stop mtmv scheduler
mtmvJobManager.stop();
if (analysisManager != null) {
analysisManager.getStatisticsCache().preHeat();
}
}

// Set global variable 'lower_case_table_names' only when the cluster is initialized.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ public StatisticsCache getStatisticsCache() {
}

public void createAnalyze(AnalyzeStmt analyzeStmt, boolean proxy) throws DdlException {
if (!StatisticsUtil.statsTblAvailable() && !FeConstants.runningUnitTest) {
throw new DdlException("Stats table not available, please make sure your cluster status is normal");
}
if (analyzeStmt instanceof AnalyzeDBStmt) {
createAnalysisJobs((AnalyzeDBStmt) analyzeStmt, proxy);
} else if (analyzeStmt instanceof AnalyzeTblStmt) {
Expand Down Expand Up @@ -324,11 +327,7 @@ public void createAnalysisJob(AnalyzeTblStmt stmt, boolean proxy) throws DdlExce

@Nullable
@VisibleForTesting
public AnalysisInfo buildAndAssignJob(AnalyzeTblStmt stmt) throws DdlException {
if (!StatisticsUtil.statsTblAvailable() && !FeConstants.runningUnitTest) {
throw new DdlException("Stats table not available, please make sure your cluster status is normal");
}

protected AnalysisInfo buildAndAssignJob(AnalyzeTblStmt stmt) throws DdlException {
AnalysisInfo jobInfo = buildAnalysisJobInfo(stmt);
if (jobInfo.colToPartitions.isEmpty()) {
// No statistics need to be collected or updated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,12 @@ public static boolean statsTblAvailable() {
.findTable(InternalCatalog.INTERNAL_CATALOG_NAME,
dbName,
StatisticConstants.STATISTIC_TBL_NAME));
statsTbls.add(
(OlapTable) StatisticsUtil
.findTable(InternalCatalog.INTERNAL_CATALOG_NAME,
dbName,
StatisticConstants.HISTOGRAM_TBL_NAME));
// uncomment it when hist is available for user.
// statsTbls.add(
// (OlapTable) StatisticsUtil
// .findTable(InternalCatalog.INTERNAL_CATALOG_NAME,
// dbName,
// StatisticConstants.HISTOGRAM_TBL_NAME));
} catch (Throwable t) {
return false;
}
Expand Down