Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClickHouse: fail to parse "WITH <expression> AS <identifier>" #3175

Closed
herry13 opened this issue Mar 20, 2024 · 2 comments · Fixed by #3190
Closed

ClickHouse: fail to parse "WITH <expression> AS <identifier>" #3175

herry13 opened this issue Mar 20, 2024 · 2 comments · Fixed by #3190
Assignees

Comments

@herry13
Copy link

herry13 commented Mar 20, 2024

Description

sqlglot fails to parse WITH <expression> AS <identifier>.

Before you file an issue

  • Make sure you specify the "read" dialect eg. parse_one(sql, read="spark") -- Yes, I have specified the "read" dialect.
  • Check if the issue still exists on main -- I have cloned and used the latest main branch. But the issue still exists.

Fully reproducible code snippet

import sqlglot
from sqlglot.dialects.clickhouse import ClickHouse

query = "WITH 1 AS var SELECT var"
sqlglot.maybe_parse(query, dialect=ClickHouse(), error_level=sqlglot.ErrorLevel.RAISE)

Official Documentation

Link to WITH Clause syntax and its example available in the ClickHouse documentation website.

@georgesittas
Copy link
Collaborator

Appreciate the report @herry13, we'll take a look soon.

@herry13
Copy link
Author

herry13 commented Mar 22, 2024

@VaggelisD Thank you for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants