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


##########
core/src/test/resources/sql/planner.iq:
##########
@@ -351,4 +351,179 @@ FROM "scott"."EMP";
 
 !ok
 
+# [CALCITE-4617] Wrong offset when SortJoinTransposeRule pushes a Sort with an 
offset
+select d.deptno, empno from "scott"."DEPT" d
+right join "scott"."EMP" e using (deptno) limit 10 offset 2;
++--------+-------+
+| DEPTNO | EMPNO |
++--------+-------+
+|     10 |  7934 |
+|     20 |  7369 |
+|     20 |  7566 |
+|     20 |  7788 |
+|     20 |  7876 |
+|     20 |  7902 |
+|     30 |  7499 |
+|     30 |  7521 |
+|     30 |  7654 |
+|     30 |  7698 |
++--------+-------+
+(10 rows)
+
+!ok
+EnumerableCalc(expr#0..2=[{inputs}], proj#0..1=[{exprs}])
+  EnumerableLimit(offset=[2], fetch=[10])
+    EnumerableHashJoin(condition=[=($0, $2)], joinType=[right])
+      EnumerableCalc(expr#0..2=[{inputs}], DEPTNO=[$t0])
+        EnumerableTableScan(table=[[scott, DEPT]])
+      EnumerableCalc(expr#0..7=[{inputs}], EMPNO=[$t0], DEPTNO=[$t7])

Review Comment:
   Indeed, I will indicate in the SQL statement that the limit 10 is due to the 
influence of volcano.



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