You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2026/03/04 10:06:00 UTC

[jira] [Created] (CALCITE-7430) 3 queries in RelOptRulesTest fail due to TopDownGeneralDecorrelator bugs

Julian Hyde created CALCITE-7430:
------------------------------------

             Summary: 3 queries in RelOptRulesTest fail due to TopDownGeneralDecorrelator bugs
                 Key: CALCITE-7430
                 URL: https://issues.apache.org/jira/browse/CALCITE-7430
             Project: Calcite
          Issue Type: Bug
            Reporter: Julian Hyde


I had to disable the '!ok' command in three tests added as part of CALCITE-7420 because they failed in CoreQuidemTest2 (even though they worked in CoreQuidemTest). Presumably these are bugs in {{TopDownGeneralDecorrelator}}.
 
The tests are visible in the [julianhyde/7420-rule-test|https://github.com/julianhyde/calcite/tree/7420-rule-test] branch, or you can run the following queries:

{noformat}
# testFilterIntoJoinMissingVariableCor (in filter-into-join.iq)
SELECT E.EMPNO
FROM EMP E
JOIN DEPT D ON E.DEPTNO = D.DEPTNO
WHERE E.EMPNO > 10 AND D.DEPTNO = (
    SELECT MIN(D_INNER.DEPTNO)
    FROM DEPT D_INNER
    WHERE D_INNER.DEPTNO = E.DEPTNO);

# testCorrelationScalarAggAndFilter (in reduce-expressions.iq)
SELECT e1.empno
FROM emp e1,
  dept d1
where e1.deptno = d1.deptno
and e1.deptno < 10 and d1.deptno < 15
and e1.sal > (select avg(sal) from emp e2 where e1.empno = e2.empno);

# testAnyInProjectNullable (in filter-sub-query-to-correlate.iq)
select deptno, dname = ANY (
  select mgr from emp) as b
from dept;
{noformat}
 
The first two give "{{java.lang.AssertionError: Correlation variable $cor0 should be defined at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.getCorrelVariableGetter(EnumerableRelImplementor.java:476)}}"; the third gives "{{java.lang.RuntimeException: while resolving method 'eq[class java.lang.String, short]' in class class org.apache.calcite.runtime.SqlFunctions}}".



--
This message was sent by Atlassian Jira
(v8.20.10#820010)