Skip to content

[BUG] JSQLParser : ClickHouse : Lambda expression in WITH clause is not supported #2632

Description

@tomershay88

ClickHouse supports lambda expressions in WITH clauses, which can then be referenced as named expressions in the SELECT statement.

JSQLParser fails to parse a minimal ClickHouse query containing a lambda expression in a WITH clause.

SQL Example

WITH (x -> x * 2) AS double
SELECT double(5);

This query executes successfully in ClickHouse and returns: 10

Parsing error

JSQLParser throws the following exception:

ParseException: Encountered:, at line 1, column 6, in lexical state DEFAULT.

The parser fails at the beginning of the WITH expression, specifically when encountering the lambda expression:

(x -> x * 2)

Tested with ClickHouse 26.8.

Activity

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

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