rubenada commented on code in PR #4754: URL: https://github.com/apache/calcite/pull/4754#discussion_r2702284996
########## core/src/test/resources/sql/new-decorr.iq: ########## @@ -42,4 +42,29 @@ SELECT * FROM t0 WHERE t0a < !ok +# [CALCITE-7382] The TopDownGeneralDecorrelator returns an error result when a subquery contains a LIMIT 1 +!use scott +SELECT dname, (SELECT emp.comm FROM "scott".emp where dept.deptno = emp.deptno ORDER BY emp.comm limit 1) FROM "scott".dept; ++------------+--------+ +| DNAME | EXPR$1 | ++------------+--------+ +| ACCOUNTING | | +| OPERATIONS | | +| RESEARCH | | +| SALES | 0.00 | ++------------+--------+ +(4 rows) + +!ok + +select dname, (select empno from emp where dept.deptno = emp.deptno limit 1) from dept where deptno = 10; Review Comment: Shouldn't we have an ORDER BY in the sub-query (before the LIMIT 1) to make sure that the query result is deterministic? -- 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]
