hsyuan commented on a change in pull request #1607: [CALCITE-3539] 
EnumerableDefaults#nestedLoopJoin returns duplicates for JoinType.SEMI
URL: https://github.com/apache/calcite/pull/1607#discussion_r351396174
 
 

 ##########
 File path: 
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableNestedLoopJoin.java
 ##########
 @@ -89,11 +90,15 @@ public static EnumerableNestedLoopJoin create(
     // and have the same cost. To make the results stable between versions of
     // the planner, make one of the versions slightly more expensive.
 
 Review comment:
   Not related with this PR.
   But I found the comments are wrong. Once the physical operator is generated 
from logical plan, it should not be flipped. Only join commutativity rule can 
flip it.
   NestedLoopJoin and HashJoin with flipped inner/outer relation have different 
cost. If the larger relation becomes inner, hashJoin may end up with spilling 
inner relation, and NestedLoopJoin may not be able to hold inner into memory. 
That's why we always prefer smaller relation as inner child whenever possible.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to