[fix](Nereids): CustomRewriteJob don't handle condition rule return null (#27516)

This commit is contained in:
jakevin
2023-11-24 14:38:37 +08:00
committed by GitHub
parent 540132f656
commit 674dd98fb2
2 changed files with 6 additions and 1 deletions

View File

@ -92,6 +92,7 @@ import org.apache.doris.nereids.rules.rewrite.PullUpProjectUnderTopN;
import org.apache.doris.nereids.rules.rewrite.PushConjunctsIntoEsScan;
import org.apache.doris.nereids.rules.rewrite.PushConjunctsIntoJdbcScan;
import org.apache.doris.nereids.rules.rewrite.PushDownCountThroughJoin;
import org.apache.doris.nereids.rules.rewrite.PushDownDistinctThroughJoin;
import org.apache.doris.nereids.rules.rewrite.PushDownFilterThroughProject;
import org.apache.doris.nereids.rules.rewrite.PushDownLimit;
import org.apache.doris.nereids.rules.rewrite.PushDownLimitDistinctThroughJoin;
@ -280,7 +281,8 @@ public class Rewriter extends AbstractBatchJobExecutor {
new PushDownSumThroughJoin(),
new PushDownMinMaxThroughJoin(),
new PushDownCountThroughJoin()
)
),
custom(RuleType.PUSH_DOWN_DISTINCT_THROUGH_JOIN, PushDownDistinctThroughJoin::new)
),
topic("Limit optimization",

View File

@ -56,6 +56,9 @@ public class CustomRewriteJob implements RewriteJob {
// COUNTER_TRACER.log(CounterEvent.of(Memo.get=-StateId(), CounterType.JOB_EXECUTION, group, logicalExpression,
// root));
Plan rewrittenRoot = customRewriter.get().rewriteRoot(root, context);
if (rewrittenRoot == null) {
return;
}
// don't remove this comment, it can help us to trace some bug when developing.