Skip to content

[sql/tsql] GROUP BY ROLLUP (expression) / WITH CUBE not supported #4662

@lf-novelt

Description

@lf-novelt

neither postgres / modern syntax

SELECT DIM_ISO3, c.NAMEWORKEN, INDICATOR, YEAR, Sum(VALUE) AS Total 
FROM pipeline_examples.RLS_DATA r WITH (NOLOCK)
INNER JOIN [pipeline_examples].[REF_COUNTRIES] c  WITH (NOLOCK)
ON c.CODE = r.DIM_ISO3
GROUP BY ROLLUP(DIM_ISO3, c.NAMEWORKEN, INDICATOR, YEAR)

or legacy WITH ROLLUP syntax

SELECT DIM_ISO3, c.NAMEWORKEN, INDICATOR, YEAR, Sum(VALUE) AS Total 
FROM pipeline_examples.RLS_DATA r WITH (NOLOCK)
INNER JOIN [pipeline_examples].[REF_COUNTRIES] c  WITH (NOLOCK)
ON c.CODE = r.DIM_ISO3
GROUP BY DIM_ISO3, c.NAMEWORKEN, INDICATOR, YEAR WITH ROLLUP

are supported.

Same for ROLLUP, CUBE specification of SQL Server.
as we can see the lines are commented out in the PARSER

group_by_item
: expression
/*| rollup_spec
| cube_spec
| grouping_sets_spec
| grand_total*/

Will push the fix in the same branch than my current PR #4651

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions