[fix](Nereids) rewritten mv should check output set and should not return null (#34288)
1. we should check output set, since we will remove top project and result output size will diff with its child output size if there are dup slot in result list 2. should not return null, instead we should return rewritten plan itself, because we will use return result in many place and do not check null at all
This commit is contained in:
@ -204,9 +204,8 @@ public class MaterializedViewUtils {
|
||||
CascadesContext cascadesContext,
|
||||
Function<CascadesContext, Plan> planRewriter,
|
||||
Plan rewrittenPlan, Plan originPlan) {
|
||||
List<Slot> originOutputs = originPlan.getOutput();
|
||||
if (originOutputs.size() != rewrittenPlan.getOutput().size()) {
|
||||
return null;
|
||||
if (originPlan.getOutputSet().size() != rewrittenPlan.getOutputSet().size()) {
|
||||
return rewrittenPlan;
|
||||
}
|
||||
// After RBO, slot order may change, so need originSlotToRewrittenExprId which record
|
||||
// origin plan slot order
|
||||
|
||||
Reference in New Issue
Block a user