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
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ public void execute(ThreadPoolExecutor executor) {
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;
}
Expand All @@ -890,7 +890,7 @@ public void execute(ThreadPoolExecutor executor) {
}
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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public ExternalAnalysisTask(AnalysisInfo info) {
}

public void doExecute() throws Exception {
if (killed) {
return;
}
if (isTableLevelTask) {
getTableStats();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public JdbcAnalysisTask(AnalysisInfo info) {
}

public void doExecute() throws Exception {
if (killed) {
return;
}
if (isTableLevelTask) {
getTableStats();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public OlapAnalysisTask(AnalysisInfo info) {
}

public void doExecute() throws Exception {
if (killed) {
return;
}
// For empty table, write empty result directly, no need to run SQL to collect stats.
if (info.rowCount == 0 && tableSample != null) {
StatsId statsId = new StatsId(concatColumnStatsId(), info.catalogId, info.dbId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
}
Expand Down