Skip to content

ClickhouseDialet doesn't support column IN ['a', 'b'] experssion #65

@tonzhoutonzhou

Description

@tonzhoutonzhou

ClickHouse supports IN [1, 2, 3] syntax because it treats [1, 2, 3] as an array literal. Therefore, the following are valid and equivalent in ClickHouse:

SELECT * FROM my_table WHERE id IN (1, 2, 3);
-- equivalent to
SELECT * FROM my_table WHERE id IN [1, 2, 3];

However, when parsing such queries using this library, the parser throws an error like:

Expected (, found [, Line: 11, Col: 43

This suggests that the parser does not support ClickHouse-style array literals. Even when using ClickHouseDialect, the parser appears to follow ANSI SQL / MySQL / PostgreSQL-style expectations and fails on valid ClickHouse syntax like [...].

Would it be possible to enhance ClickHouseDialect and the parser logic to support IN [...] and array literal expressions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions