Skip to content

[Bug]: Trino dialect doesn't handle array functions that use an arrow "->". #1302

Open
@ademille

Description

@ademille

What happened?

When formatting valid Trino SQL that has an ascii arrow "->", the formatter will insert a space, making the SQL invalid.
Source:

SELECT array_sort(ARRAY[3, 2, 5, 1, 2], (x, y) -> IF(x < y, 1, IF(x = y, 0, -1)));

Formatted with Trino dialect:

SELECT
    array_sort(ARRAY[3, 2, 5, 1, 2], (X, Y) - > IF (x < y, 1, IF (x = y, 0, - 1)));

Notice that the arrow now has a space between the '-' and '>' characters.

Arrows in Trino SQL should not be modified.

Version

No response

Checked in Playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions