backport: https://github.com/apache/doris/pull/45441
This commit is contained in:
@ -123,15 +123,6 @@ public class StatisticsAutoCollector extends MasterDaemon {
|
||||
|
||||
protected void processOneJob(TableIf table, JobPriority priority)
|
||||
throws DdlException, ExecutionException, InterruptedException {
|
||||
List<Pair<String, String>> needRunColumns = table.getColumnIndexPairs(
|
||||
table.getSchemaAllIndexes(false)
|
||||
.stream()
|
||||
.filter(c -> !StatisticsUtil.isUnsupportedType(c.getType()))
|
||||
.map(Column::getName)
|
||||
.collect(Collectors.toSet()));
|
||||
if (needRunColumns == null || needRunColumns.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
AnalysisMethod analysisMethod =
|
||||
table.getDataSize(true) >= StatisticsUtil.getHugeTableLowerBoundSizeInBytes()
|
||||
? AnalysisMethod.SAMPLE : AnalysisMethod.FULL;
|
||||
@ -151,6 +142,15 @@ public class StatisticsAutoCollector extends MasterDaemon {
|
||||
}
|
||||
return;
|
||||
}
|
||||
List<Pair<String, String>> needRunColumns = table.getColumnIndexPairs(
|
||||
table.getSchemaAllIndexes(false)
|
||||
.stream()
|
||||
.filter(c -> !StatisticsUtil.isUnsupportedType(c.getType()))
|
||||
.map(Column::getName)
|
||||
.collect(Collectors.toSet()));
|
||||
if (needRunColumns == null || needRunColumns.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
StringJoiner stringJoiner = new StringJoiner(",", "[", "]");
|
||||
for (Pair<String, String> pair : needRunColumns) {
|
||||
stringJoiner.add(pair.toString());
|
||||
|
||||
@ -67,6 +67,11 @@ public class StatisticsAutoCollectorTest {
|
||||
count[0]++;
|
||||
return Pair.of(null, JobPriority.LOW);
|
||||
}
|
||||
|
||||
@Mock
|
||||
protected void processOneJob(TableIf table, JobPriority priority) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
count[0] = 0;
|
||||
count[1] = 0;
|
||||
|
||||
@ -717,14 +717,6 @@ suite("test_analyze_mv") {
|
||||
empty_test = sql """show auto analyze mvTestDup"""
|
||||
assertEquals(0, empty_test.size())
|
||||
empty_test = sql """show column stats mvTestDup"""
|
||||
for (int i = 0; i < 100; i++) {
|
||||
empty_test = sql """show column stats mvTestDup"""
|
||||
if (empty_test.size() != 0) {
|
||||
logger.info("async delete is not finished yet.")
|
||||
Thread.sleep(1000)
|
||||
}
|
||||
break
|
||||
}
|
||||
assertEquals(0, empty_test.size())
|
||||
// ** End of embedded test
|
||||
|
||||
|
||||
Reference in New Issue
Block a user