Hi,

I'm using the Jdbc Adapter and the SCOTT schema (emp, dept and salgrade).

When i execute the following query (i know that the second join doesn't
make sense, but it's only to show the error):

> SELECT count(*) FROM (SELECT count(emp.empno) `Count Emp`, dept.dname
> `Department Name` FROM Calcite.emp emp JOIN Calcite.dept dept ON emp.deptno
> = dept.deptno JOIN Calcite.salgrade salgrade ON emp.comm = salgrade.hisal
> WHERE dept.dname LIKE '%O%' GROUP BY emp.deptno, dept.dname)


a CastException is thrown:
"org.apache.calcite.adapter.jdbc.JdbcRules$JdbcJoin cannot be cast to
org.apache.calcite.adapter.enumerable.EnumerableRel".

generates a plan:

> [TABLE, #ID {PLAN=EnumerableAggregate(group=[{}], EXPR$0=[COUNT()])
>   EnumerableAggregate(group=[{2, 4}])
>     JdbcJoin(condition=[=($1, $0)], joinType=[inner])
>       JdbcProject(hisal=[$2])
>         JdbcTableScan(table=[[Calcite, salgrade]])
>       JdbcJoin(condition=[=($1, $2)], joinType=[inner])
>         JdbcProject(comm=[$6], deptno=[$7])
>           JdbcTableScan(table=[[Calcite, emp]])
>         JdbcProject(deptno=[$0], dname=[$1])
>           JdbcFilter(condition=[LIKE($1, '%O%')])
>             JdbcTableScan(table=[[Calcite, dept]])
> , }]


Can i create an issue for this?

Best regards,
Miguel.

Reply via email to