Skip to content

GROUPING SETS with parenthesised sets gives a value instead of NULL for a column outside the set #3152

Backlog

Description

@mathiasrw
alasql('SELECT a, b, COUNT(*) AS c FROM ? GROUP BY GROUPING SETS((a), (b))', [[{a: 2, b: 3}, {a: 2, b: 4}]]);
alasql('SELECT a, b, COUNT(*) AS c FROM ? GROUP BY GROUPING SETS(a, b)', [[{a: 2, b: 3}, {a: 2, b: 4}]]);

The first gives [{a: 2, b: 3, c: 2}, {a: 2, b: 3, c: 1}, {a: 2, b: 4, c: 1}].

It should give [{a: 2, b: null, c: 2}, {a: null, b: 3, c: 1}, {a: null, b: 4, c: 1}], as the second query and PostgreSQL do.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions