Skip to content

4.1 Parser fails on H2 Ordered Aggregate Functions #1183

Closed

Description

@manticore-projects

Just stumpled over this:

-- LISTAGG 3: fails to parse
SELECT LISTAGG(ID, ', ') WITHIN GROUP (ORDER BY ID) OVER (ORDER BY ID);

-- ARRAY_AGG 2: fails to deparse correctly
SELECT ARRAY_AGG(NAME ORDER BY ID) FILTER (WHERE NAME IS NOT NULL);

-- ARRAY_AGG 3 fails to deparse correctly
SELECT ARRAY_AGG(ID ORDER BY ID) OVER (ORDER BY ID);

net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "BY" "BY"
at line 1, column 65.

I will look into this and try to craft a PR when I find some time.

Activity

  1. wumpz commented on May 1, 2021

    @wumpz
    Member

    The second and third SQL is now parsed and deparsed successfully.

  2. wumpz commented on May 1, 2021

    @wumpz
    Member

    To the first one: I was not aware that additional to this "within group" an over clause is valid.

  3. manticore-projects commented on Nov 22, 2022

    @manticore-projects
    ContributorAuthor

    Should be address by PR #1666.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions