Jerome Isaac Haltom created CALCITE-7774:
--------------------------------------------
Summary: JDBC adapter generates a GROUP BY with a constant key,
which SQL Server rejects
Key: CALCITE-7774
URL: https://issues.apache.org/jira/browse/CALCITE-7774
Project: Calcite
Issue Type: Bug
Components: core
Affects Versions: 1.42.0
Reporter: Jerome Isaac Haltom
SQL Server doesn't allow a constant as a GROUP BY key, and the JDBC adapter
sends one anyway.
{code:sql}
select count(*) from "EMPS" group by 'a'
{code}
comes out as
{code:sql}
SELECT COUNT(*) FROM [dbo].[EMPS] GROUP BY 'a'
{code}
and SQL Server 2019 answers:
{code}
Each GROUP BY expression must contain at least one column that is not an outer
reference.
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)