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

Fix(clickhouse): map ApproxDistinct to uniq, AnyValue to any #1635

Merged
merged 5 commits into from
May 16, 2023

Conversation

georgesittas
Copy link
Collaborator

Fixes #1633

@ewjoachim
Copy link

I wonder if the transpilation the other way around works (clickhouse > bigquery) given that we modified the parser of BQ and the Generator of CH and not the other way around.

@georgesittas
Copy link
Collaborator Author

georgesittas commented May 16, 2023

No, it doesn't currently work backwards. I'm working on this, we need to make some adjustments in the parser to handle Clickhouse's partial case sensitivity in function names... Sigh.

EDIT: nevermind, I opted for a simpler solution.

sqlglot/parser.py Outdated Show resolved Hide resolved
@ewjoachim
Copy link

to handle Clickhouse's partial case sensitivity in function names... Sigh.

I feel you. I discovered this today and sighed as well. Not all SQL dialects are created equal :)

@georgesittas georgesittas merged commit bba360c into main May 16, 2023
@georgesittas georgesittas deleted the jo/approx_distinct branch May 16, 2023 15:16
adrianisk pushed a commit to adrianisk/sqlglot that referenced this pull request Jun 21, 2023
…#1635)

* Fix(clickhouse): map ApproxDistinct to uniq, AnyValue to any

* Make Clickhouse -> Bigquery work too

* Fixup

* Fixup

* Use _sql_names to get rid of FUNCTIONS entry for ApproxDistinct
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 this pull request may close these issues.

APPROX_COUNT_DISTINCT and ANY_VALUE
3 participants