Skip to content

Commit

Permalink
fix regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
seawinde committed Sep 23, 2024
1 parent d7cc2b0 commit 120c66f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.apache.commons.lang3.tuple.Pair;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -566,9 +567,23 @@ public void computeFd(DataTrait.Builder builder) {

Map<Slot, Slot> constructReplaceMap(MTMV mtmv) {
Map<Slot, Slot> replaceMap = new HashMap<>();
List<Slot> originOutputs = mtmv.getCache().getOriginalPlan().getOutput();
for (int i = 0; i < getOutput().size(); i++) {
replaceMap.put(originOutputs.get(i), getOutput().get(i));
// Need remove invisible column, and then mapping them
List<Slot> originOutputs = new ArrayList<>();
for (Slot originSlot : mtmv.getCache().getOriginalPlan().getOutput()) {
if (!(originSlot instanceof SlotReference) || (((SlotReference) originSlot).isVisible())) {
originOutputs.add(originSlot);
}
}
List<Slot> targetOutputs = new ArrayList<>();
for (Slot targeSlot : getOutput()) {
if (!(targeSlot instanceof SlotReference) || (((SlotReference) targeSlot).isVisible())) {
targetOutputs.add(targeSlot);
}
}
Preconditions.checkArgument(originOutputs.size() == targetOutputs.size(),
"constructReplaceMap, the size of originOutputs and targetOutputs should be same");
for (int i = 0; i < targetOutputs.size(); i++) {
replaceMap.put(originOutputs.get(i), targetOutputs.get(i));
}
return replaceMap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ class Suite implements GroovyInterceptable {
}
Assert.assertEquals("SUCCESS", status)
logger.info("waitingMTMVTaskFinished analyze mv name is " + result.last().get(5))
sql "analyze table ${mvName} with sync;"
sql "analyze table ${result.last().get(6)}.${mvName} with sync;"
}

void waitingMTMVTaskFinishedByMvNameAllowCancel(String mvName) {
Expand All @@ -1330,7 +1330,7 @@ class Suite implements GroovyInterceptable {
Assert.assertEquals("SUCCESS", status)
// Need to analyze materialized view for cbo to choose the materialized view accurately
logger.info("waitingMTMVTaskFinished analyze mv name is " + result.last().get(5))
sql "analyze table ${mvName} with sync;"
sql "analyze table ${result.last().get(6)}.${mvName} with sync;"
}

void waitingPartitionIsExpected(String tableName, String partitionName, boolean expectedStatus) {
Expand Down Expand Up @@ -1381,7 +1381,7 @@ class Suite implements GroovyInterceptable {
Assert.assertEquals("SUCCESS", status)
// Need to analyze materialized view for cbo to choose the materialized view accurately
logger.info("waitingMTMVTaskFinished analyze mv name is " + result.last().get(5))
sql "analyze table ${result.last().get(5)} with sync;"
sql "analyze table ${result.last().get(6)}.${result.last().get(5)} with sync;"
}

void waitingMTMVTaskFinishedNotNeedSuccess(String jobName) {
Expand Down

0 comments on commit 120c66f

Please sign in to comment.