Sean Broeder created CALCITE-7838:
-------------------------------------
Summary: JDBC adapter generates nested aggregate SQL that throws
an exception on HSQLDB
Key: CALCITE-7838
URL: https://issues.apache.org/jira/browse/CALCITE-7838
Project: Calcite
Issue Type: Bug
Components: core
Affects Versions: 1.42.0
Reporter: Sean Broeder
Assignee: Sean Broeder
For an aggregate over an expression containing another aggregate, the JDBC
adapter pushes down a nested aggregate function, but HSQLDB rejects it by
throwing an exception.
Can be demonstrated with:
SELECT SUM(m)
FROM (
SELECT CAST(SUM(sal) AS DOUBLE) AS m
FROM scott.emp
GROUP BY deptno
);
This returns
"java.sql.SQLSyntaxErrorException: user lacks privilege or object not found:
SAL (org.hsqldb.HsqlException, raised from
ExpressionColumn.checkColumnsResolved while compiling the statement)"
The dialect should report that it doesn't support nested aggregations so that a
wrapped sub-SELECT is generated.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)