Skip to content

Commit

Permalink
[fix](statistics) Fix show auto analyze missing jobs bug (apache#27761)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jibing-Li authored and gnehil committed Dec 4, 2023
1 parent c5143f5 commit f6b3d2e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ protected SimpleQueue<AnalysisInfo> createSimpleQueue(Collection<AnalysisInfo> c
a -> {
// DO NOTHING
return null;
}, null);
}, collection);
}

// Remove col stats status from TableStats if failed load some col stats after analyze corresponding column so that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.doris.statistics.AnalysisInfo.AnalysisType;
import org.apache.doris.statistics.AnalysisInfo.JobType;
import org.apache.doris.statistics.AnalysisInfo.ScheduleType;
import org.apache.doris.statistics.util.SimpleQueue;
import org.apache.doris.statistics.util.StatisticsUtil;

import com.google.common.annotations.VisibleForTesting;
Expand Down Expand Up @@ -445,4 +446,16 @@ public void testRecordLimit3() {
Assertions.assertEquals(2, analysisManager.autoJobs.size());
}

@Test
public void testCreateSimpleQueue() {
AnalysisManager analysisManager = new AnalysisManager();
ArrayList<AnalysisInfo> jobs = Lists.newArrayList();
jobs.add(new AnalysisInfoBuilder().setJobId(1).build());
jobs.add(new AnalysisInfoBuilder().setJobId(2).build());
SimpleQueue<AnalysisInfo> simpleQueue = analysisManager.createSimpleQueue(jobs, analysisManager);
Assertions.assertEquals(2, simpleQueue.size());
simpleQueue = analysisManager.createSimpleQueue(null, analysisManager);
Assertions.assertEquals(0, simpleQueue.size());
}

}

0 comments on commit f6b3d2e

Please sign in to comment.