Andrey Mashenkov created IGNITE-26335:
-----------------------------------------

             Summary: 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


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.



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

Reply via email to