[fix](nereids) need run ConvertInnerOrCrossJoin rule again after EliminateNotNull (#21346)
after running EliminateNotNull rule, the join conjuncts may be removed from inner join node. So need run ConvertInnerOrCrossJoin rule to convert inner join with no join conjuncts to cross join node.
This commit is contained in:
@ -207,7 +207,8 @@ public class Rewriter extends AbstractBatchJobExecutor {
|
||||
),
|
||||
// eliminate useless not null or inferred not null
|
||||
// TODO: wait InferPredicates to infer more not null.
|
||||
bottomUp(new EliminateNotNull())
|
||||
bottomUp(new EliminateNotNull()),
|
||||
topDown(new ConvertInnerOrCrossJoin())
|
||||
),
|
||||
topic("Column pruning and infer predicate",
|
||||
custom(RuleType.COLUMN_PRUNING, ColumnPruning::new),
|
||||
|
||||
@ -21,7 +21,6 @@ import org.apache.doris.common.Pair;
|
||||
import org.apache.doris.nereids.cost.Cost;
|
||||
import org.apache.doris.nereids.properties.LogicalProperties;
|
||||
import org.apache.doris.nereids.properties.PhysicalProperties;
|
||||
import org.apache.doris.nereids.trees.expressions.literal.Literal;
|
||||
import org.apache.doris.nereids.trees.plans.JoinType;
|
||||
import org.apache.doris.nereids.trees.plans.Plan;
|
||||
import org.apache.doris.nereids.trees.plans.logical.LogicalJoin;
|
||||
@ -377,12 +376,12 @@ public class Group {
|
||||
*/
|
||||
public boolean isInnerJoinGroup() {
|
||||
Plan plan = getLogicalExpression().getPlan();
|
||||
if (plan instanceof LogicalJoin) {
|
||||
// Right now, we only support inner join with some join conditions
|
||||
return ((LogicalJoin) plan).getJoinType() == JoinType.INNER_JOIN
|
||||
&& (((LogicalJoin) plan).getOtherJoinConjuncts().isEmpty()
|
||||
|| !(((LogicalJoin) plan).getOtherJoinConjuncts()
|
||||
.get(0) instanceof Literal));
|
||||
if (plan instanceof LogicalJoin
|
||||
&& ((LogicalJoin) plan).getJoinType() == JoinType.INNER_JOIN) {
|
||||
// Right now, we only support inner join
|
||||
Preconditions.checkArgument(!((LogicalJoin) plan).getExpressions().isEmpty(),
|
||||
"inner join must have join conjuncts");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user