joeyutong commented on code in PR #4088:
URL: https://github.com/apache/calcite/pull/4088#discussion_r1886113872
##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnUniqueness.java:
##########
@@ -321,15 +321,16 @@ public Boolean areColumnsUnique(Intersect rel,
RelMetadataQuery mq,
}
final JoinInfo joinInfo = rel.analyzeCondition();
-
- // Joining with a singleton constrains the keys on the other table
- final Double rightMaxRowCount = mq.getMaxRowCount(right);
- if (rightMaxRowCount != null && rightMaxRowCount <= 1.0) {
- leftColumns = leftColumns.union(joinInfo.leftSet());
- }
- final Double leftMaxRowCount = mq.getMaxRowCount(left);
- if (leftMaxRowCount != null && leftMaxRowCount <= 1.0) {
- rightColumns = rightColumns.union(joinInfo.rightSet());
+ if (rel.getJoinType() == JoinRelType.INNER) {
+ // Joining with a singleton constrains the keys on the other table
+ final Double rightMaxRowCount = mq.getMaxRowCount(right);
+ if (rightMaxRowCount != null && rightMaxRowCount <= 1.0) {
+ leftColumns = leftColumns.union(joinInfo.leftSet());
Review Comment:
@mihaibudiu Any more thoughts on this? Please take another look when you
have a moment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]