[
https://issues.apache.org/jira/browse/IGNITE-26335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrey Mashenkov updated IGNITE-26335:
--------------------------------------
Description:
Query with GROUPING aggregate over single group and values failed on validation
stage
{noformat}
SELECT GROUPING(f2), f1
FROM ( VALUES ... ) as t(f1,f2)
GROUP BY ALL GROUPING SETS ((f2, f1)){noformat}
Similar query over 2 values and duplicate groups failed on AST conversion
{code:java}
SELECT GROUPING(f2), f1
FROM ( VALUES (1,1), (2,2)) as t(f1,f2)
GROUP BY ALL GROUPING SETS ((f2, f1), (f1, f2)){code}
The error is similar in both cases, Calcite build projection with incorrect
rowType.
The GROUPING function returns BIGINT, but Calcite sets INTEGER to project
without a cast.
Looks like a bug in Calcite and there is no workaround.
was:
Query with GROUPING aggregate over single group and values failed on validation
stage
{noformat}
SELECT GROUPING(f2), f1
FROM ( VALUES ... ) as t(f1,f2)
GROUP BY ALL GROUPING SETS ((f2, f1)){noformat}
Similar query over 2 values and duplicate groups failed on parsing stage
{code:java}
SELECT GROUPING(f2), f1
FROM ( VALUES (1,1), (2,2)) as t(f1,f2)
GROUP BY ALL GROUPING SETS ((f2, f1), (f1, f2)){code}
The error is similar in both cases, Calcite build projection with incorrect
rowType.
The GROUPING function returns BIGINT, but Calcite sets INTEGER to project
without a cast.
Looks like a bug in Calcite and there is no workaround.
> Sql. Failed to parse query with GROUPING aggregate over VALUES.
> ---------------------------------------------------------------
>
> Key: IGNITE-26335
> URL: https://issues.apache.org/jira/browse/IGNITE-26335
> Project: Ignite
> Issue Type: Bug
> Components: sql ai3
> Reporter: Andrey Mashenkov
> Priority: Major
> Labels: ignite-3
>
> Query with GROUPING aggregate over single group and values failed on
> validation stage
> {noformat}
> SELECT GROUPING(f2), f1
> FROM ( VALUES ... ) as t(f1,f2)
> GROUP BY ALL GROUPING SETS ((f2, f1)){noformat}
> Similar query over 2 values and duplicate groups failed on AST conversion
> {code:java}
> SELECT GROUPING(f2), f1
> FROM ( VALUES (1,1), (2,2)) as t(f1,f2)
> GROUP BY ALL GROUPING SETS ((f2, f1), (f1, f2)){code}
> The error is similar in both cases, Calcite build projection with incorrect
> rowType.
> The GROUPING function returns BIGINT, but Calcite sets INTEGER to project
> without a cast.
> Looks like a bug in Calcite and there is no workaround.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)