backport https://github.com/apache/doris/pull/33836 <!--Describe your changes.--> ## Further comments If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
This commit is contained in:
@ -811,7 +811,7 @@ public class AnalysisManager implements Writable {
|
||||
executor.submit(() -> {
|
||||
try {
|
||||
if (cancelled) {
|
||||
errorMessages.add("Query timeout or user cancelled."
|
||||
errorMessages.add("Query Timeout or user Cancelled."
|
||||
+ "Could set analyze_timeout to a bigger value.");
|
||||
return;
|
||||
}
|
||||
@ -834,7 +834,7 @@ public class AnalysisManager implements Writable {
|
||||
}
|
||||
if (!colNames.isEmpty()) {
|
||||
if (cancelled) {
|
||||
throw new RuntimeException("Cancelled");
|
||||
throw new RuntimeException("User Cancelled or Timeout.");
|
||||
}
|
||||
throw new RuntimeException("Failed to analyze following columns:[" + String.join(",", colNames)
|
||||
+ "] Reasons: " + String.join(",", errorMessages));
|
||||
|
||||
@ -56,6 +56,9 @@ public class ExternalAnalysisTask extends BaseAnalysisTask {
|
||||
}
|
||||
|
||||
public void doExecute() throws Exception {
|
||||
if (killed) {
|
||||
return;
|
||||
}
|
||||
if (isTableLevelTask) {
|
||||
getTableStats();
|
||||
} else {
|
||||
|
||||
@ -60,6 +60,9 @@ public class JdbcAnalysisTask extends BaseAnalysisTask {
|
||||
}
|
||||
|
||||
public void doExecute() throws Exception {
|
||||
if (killed) {
|
||||
return;
|
||||
}
|
||||
if (isTableLevelTask) {
|
||||
getTableStats();
|
||||
} else {
|
||||
|
||||
@ -65,6 +65,9 @@ public class OlapAnalysisTask extends BaseAnalysisTask {
|
||||
}
|
||||
|
||||
public void doExecute() throws Exception {
|
||||
if (killed) {
|
||||
return;
|
||||
}
|
||||
List<Pair<String, String>> columnList = info.jobColumns;
|
||||
if (StatisticsUtil.isEmptyTable(tbl, info.analysisMethod) || columnList == null || columnList.isEmpty()) {
|
||||
StatsId statsId = new StatsId(concatColumnStatsId(), info.catalogId, info.dbId,
|
||||
|
||||
@ -34,9 +34,10 @@ suite("test_hive_statistic_timeout", "p2,external,hive,external_remote,external_
|
||||
sql """use ${catalog_name}.tpch_1000_parquet"""
|
||||
sql """set global analyze_timeout=1"""
|
||||
try {
|
||||
sql """analyze table part (p_partkey, p_container, p_type, p_retailprice) with sync with full;"""
|
||||
} catch (Exception e) {
|
||||
assertTrue(e.getMessage().contains("Cancelled"));
|
||||
test {
|
||||
sql """analyze table part (p_partkey, p_container, p_type, p_retailprice) with sync with full;"""
|
||||
exception "Timeout"
|
||||
}
|
||||
} finally {
|
||||
sql """set global analyze_timeout=43200"""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user