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


##########
core/src/main/java/org/apache/calcite/rel/rules/SortJoinTransposeRule.java:
##########
@@ -23,18 +23,23 @@
 import org.apache.calcite.rel.RelFieldCollation;
 import org.apache.calcite.rel.RelNode;
 import org.apache.calcite.rel.core.Join;
-import org.apache.calcite.rel.core.JoinInfo;
 import org.apache.calcite.rel.core.JoinRelType;
 import org.apache.calcite.rel.core.Sort;
 import org.apache.calcite.rel.logical.LogicalJoin;
 import org.apache.calcite.rel.logical.LogicalSort;
 import org.apache.calcite.rel.metadata.RelMdUtil;
 import org.apache.calcite.rel.metadata.RelMetadataQuery;
+import org.apache.calcite.rex.RexBuilder;
 import org.apache.calcite.rex.RexDynamicParam;
+import org.apache.calcite.rex.RexLiteral;
+import org.apache.calcite.rex.RexNode;
 import org.apache.calcite.tools.RelBuilderFactory;
 
+import org.checkerframework.checker.nullness.qual.Nullable;
 import org.immutables.value.Value;
 
+import java.math.BigDecimal;
+

Review Comment:
   I'm not sure if this JavaDoc is appropriate, please take a look and if so, 
I'll update it. Alternatively, I'd appreciate any suggestions.
   ```
   /**
    * Planner rule that pushes a {@link Sort} past a {@link Join} to enable 
more efficient sorting.
    *
    * <p>This rule applies to left and right outer joins, and only pushes the 
sort if its keys are entirely from one input.
    * It will not fire if the sort uses dynamic parameters or the input is 
already sorted and limited.
    *
    * <p>For example, given the SQL:
    * <pre>
    *   SELECT * FROM EMP
    *   LEFT JOIN DEPT ON EMP.deptno = DEPT.deptno
    *   ORDER BY EMP.ename
    *   LIMIT 10
    * </pre>
    * The initial plan:
    * <pre>
    *   LogicalSort(fetch=[10], sort0=[$1], dir0=[ASC])
    *     LogicalJoin(condition=[=($0, $2)], joinType=[left])
    *       LogicalTableScan(table=[[EMP]])
    *       LogicalTableScan(table=[[DEPT]])
    * </pre>
    * After applying this rule:
    * <pre>
    *   LogicalSort(fetch=[10], sort0=[$1], dir0=[ASC])
    *     LogicalJoin(condition=[=($0, $2)], joinType=[left])
    *       LogicalSort(fetch=[10], sort0=[$1], dir0=[ASC])
    *         LogicalTableScan(table=[[EMP]])
    *       LogicalTableScan(table=[[DEPT]])
    * </pre>
    *
    * @see org.apache.calcite.rel.rules.CoreRules#SORT_JOIN_TRANSPOSE
    */
   ```



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