xiedeyantu commented on code in PR #4515:
URL: https://github.com/apache/calcite/pull/4515#discussion_r2311759566


##########
core/src/main/java/org/apache/calcite/rel/rules/SortJoinTransposeRule.java:
##########
@@ -102,10 +101,7 @@ public SortJoinTransposeRule(Class<? extends Sort> 
sortClass,
             return false;
           }
         }
-      }
-      if (sort.offset != null

Review Comment:
   JOIN is an unordered operation, even if its left and right child nodes have 
been sorted earlier. For example, in 
   "SORT(offset=2)-LEFTJOIN", even if the join keys of the right table are 
unique, it is not safe to push the OFFSET down to the left table. This is 
because Calcite's current JOIN computation logic cannot guarantee that 
performing the offset first and then computing the JOIN yields the same result 
as computing the JOIN first and then applying the offset. The same logic 
applies to other database systems as well. Therefore, prohibiting the pushdown 
of OFFSET is a safe equivalent transformation. Hence, the PR directly disallows 
the pushdown of OFFSET.



-- 
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]

Reply via email to