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 @@ -595,10 +595,6 @@ public void analyze(Analyzer analyzer) throws UserException {
if (needToSql) {
sqlString = toSql();
}
if (analyzer.enableStarJoinReorder()) {
LOG.debug("use old reorder logical in select stmt");
reorderTable(analyzer);
}

resolveInlineViewRefs(analyzer);

Expand Down Expand Up @@ -790,7 +786,7 @@ public void materializeRequiredSlots(Analyzer analyzer) throws AnalysisException
}
}

protected void reorderTable(Analyzer analyzer) throws AnalysisException {
public void reorderTable(Analyzer analyzer) throws AnalysisException {
List<Pair<TableRef, Long>> candidates = Lists.newArrayList();
ArrayList<TableRef> originOrderBackUp = Lists.newArrayList(fromClause.getTableRefs());
// New pair of table ref and row count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,11 @@ private PlanNode createSelectPlan(SelectStmt selectStmt, Analyzer analyzer, long
return createConstantSelectPlan(selectStmt, analyzer);
}

if (analyzer.enableStarJoinReorder()) {
LOG.debug("use old reorder logical in select stmt");
selectStmt.reorderTable(analyzer);
}

// Slot materialization:
// We need to mark all slots as materialized that are needed during the execution
// of selectStmt, and we need to do that prior to creating plans for the TableRefs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,17 @@ public void testExpiredJobCancellation() throws Exception {
.build();
OlapAnalysisTask analysisJob = new OlapAnalysisTask(analysisTaskScheduler, analysisJobInfo);

new Expectations() {
{
analysisTaskScheduler.getPendingTasks();
result = analysisJob;
new MockUp<AnalysisTaskScheduler>() {
public synchronized BaseAnalysisTask getPendingTasks() {
return analysisJob;
}
};

AnalysisTaskExecutor analysisTaskExecutor = new AnalysisTaskExecutor(analysisTaskScheduler);
BlockingQueue<AnalysisTaskWrapper> b = Deencapsulation.getField(analysisTaskExecutor, "jobQueue");
AnalysisTaskWrapper analysisTaskWrapper = new AnalysisTaskWrapper(analysisTaskExecutor, analysisJob);
Deencapsulation.setField(analysisTaskWrapper, "startTime", 5);
b.put(analysisTaskWrapper);
new Expectations() {
{
analysisTaskWrapper.cancel();
times = 1;
}
};
analysisTaskExecutor.start();
BlockingCounter counter = Deencapsulation.getField(analysisTaskExecutor, "blockingCounter");
int sleepTime = 500;
Expand Down