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


##########
core/src/main/java/org/apache/calcite/rel/rules/SortJoinTransposeRule.java:
##########
@@ -174,6 +177,24 @@ public SortJoinTransposeRule(Class<? extends Sort> 
sortClass,
     call.transformTo(sortCopy);
   }
 
+  /**
+   * Returns the fetch value for the inner sort when pushing sort past join.
+   * The value is outer sort's offset + fetch.
+   *
+   * @param sort the outer sort
+   * @param rexBuilder RexBuilder to create literals
+   * @return fetch for inner sort
+   */
+  private static @Nullable RexNode calculateInnerSortFetch(Sort sort, 
RexBuilder rexBuilder) {
+    if (sort.fetch == null) {
+      return null;
+    }
+    final int outerFetch = RexLiteral.intValue(sort.fetch);

Review Comment:
   I agree, perhaps a new PR is needed specifically to modify this type of 
operation.



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