[fix](nereids) update outer join estimation #21126
the row count of left outer join should be no less than left child row count.
This commit is contained in:
@ -279,10 +279,12 @@ public class JoinEstimation {
|
||||
} else if (joinType == JoinType.LEFT_OUTER_JOIN) {
|
||||
Statistics innerJoinStats = estimateInnerJoin(leftStats, rightStats, join);
|
||||
double rowCount = Math.max(leftStats.getRowCount(), innerJoinStats.getRowCount());
|
||||
rowCount = Math.max(leftStats.getRowCount(), rowCount);
|
||||
return innerJoinStats.withRowCount(rowCount);
|
||||
} else if (joinType == JoinType.RIGHT_OUTER_JOIN) {
|
||||
Statistics innerJoinStats = estimateInnerJoin(leftStats, rightStats, join);
|
||||
double rowCount = Math.max(rightStats.getRowCount(), innerJoinStats.getRowCount());
|
||||
rowCount = Math.max(rowCount, rightStats.getRowCount());
|
||||
return innerJoinStats.withRowCount(rowCount);
|
||||
} else if (joinType == JoinType.FULL_OUTER_JOIN) {
|
||||
Statistics innerJoinStats = estimateInnerJoin(leftStats, rightStats, join);
|
||||
|
||||
Reference in New Issue
Block a user