[fix](nereids)need add mark join slot to upper project in PullUpProjectUnderApply rule (#31408)

This commit is contained in:
starocean999
2024-02-28 22:31:29 +08:00
committed by yiguolei
parent 5e80a718fd
commit 4a5283b466
3 changed files with 7 additions and 16 deletions

View File

@ -65,6 +65,9 @@ public class PullUpProjectUnderApply extends OneRewriteRuleFactory {
"ScalarSubquery should only have one output column");
newProjects.add(project.getProjects().get(0));
}
if (apply.isMarkJoin()) {
newProjects.add(apply.getMarkJoinSlotReference().get());
}
return project.withProjectsAndChild(newProjects, newCorrelate);
}).toRule(RuleType.PULL_UP_PROJECT_UNDER_APPLY);
}

View File

@ -25,7 +25,7 @@ import com.google.common.collect.ImmutableList;
/**
* A special type of column that will be generated to replace the subquery when unnesting the subquery of MarkJoin.
*/
public class MarkJoinSlotReference extends SlotReference implements SlotNotFromChildren {
public class MarkJoinSlotReference extends SlotReference {
final boolean existsHasAgg;
public MarkJoinSlotReference(String name) {