Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -197,38 +197,33 @@ public void createAnalysisJobs(AnalyzeDBStmt analyzeDBStmt, boolean proxy) throw

public List<AnalysisInfo> buildAnalysisInfosForDB(DatabaseIf<TableIf> db, AnalyzeProperties analyzeProperties)
throws AnalysisException {
db.readLock();
List<TableIf> tbls = db.getTables();
List<AnalysisInfo> analysisInfos = new ArrayList<>();
try {
List<AnalyzeTblStmt> analyzeStmts = new ArrayList<>();
for (TableIf table : tbls) {
if (table instanceof View) {
continue;
}
TableName tableName = new TableName(db.getCatalog().getName(), db.getFullName(), table.getName());
// columnNames null means to add all visible columns.
// Will get all the visible columns in analyzeTblStmt.check()
AnalyzeTblStmt analyzeTblStmt = new AnalyzeTblStmt(analyzeProperties, tableName,
null, db.getId(), table);
try {
analyzeTblStmt.check();
} catch (AnalysisException analysisException) {
LOG.warn("Failed to build analyze job: {}",
analysisException.getMessage(), analysisException);
}
analyzeStmts.add(analyzeTblStmt);
List<AnalyzeTblStmt> analyzeStmts = new ArrayList<>();
for (TableIf table : tbls) {
if (table instanceof View) {
continue;
}
for (AnalyzeTblStmt analyzeTblStmt : analyzeStmts) {
try {
analysisInfos.add(buildAndAssignJob(analyzeTblStmt));
} catch (DdlException e) {
LOG.warn("Failed to build analyze job: {}",
e.getMessage(), e);
}
TableName tableName = new TableName(db.getCatalog().getName(), db.getFullName(), table.getName());
// columnNames null means to add all visible columns.
// Will get all the visible columns in analyzeTblStmt.check()
AnalyzeTblStmt analyzeTblStmt = new AnalyzeTblStmt(analyzeProperties, tableName,
null, db.getId(), table);
try {
analyzeTblStmt.check();
} catch (AnalysisException analysisException) {
LOG.warn("Failed to build analyze job: {}",
analysisException.getMessage(), analysisException);
}
analyzeStmts.add(analyzeTblStmt);
}
for (AnalyzeTblStmt analyzeTblStmt : analyzeStmts) {
try {
analysisInfos.add(buildAndAssignJob(analyzeTblStmt));
} catch (DdlException e) {
LOG.warn("Failed to build analyze job: {}",
e.getMessage(), e);
}
} finally {
db.readUnlock();
}
return analysisInfos;
}
Expand Down
Loading