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

APPROX_PERCENTILE is translated from Trino to APPROX_QUANTILE in Snowflake, which does not exist in Snowflake #3424

Closed
baruchoxman opened this issue May 8, 2024 · 0 comments · Fixed by #3426
Assignees

Comments

@baruchoxman
Copy link

Fully reproducible code snippet

>>> sql = "SELECT APPROX_PERCENTILE(a,1, 0.5, 0.001) from t"
>>> select = sqlglot.parse_one(sql, "trino")
>>> select.sql("snowflake")
'SELECT APPROX_QUANTILE(a, 0.5, 0.001, 1) FROM t'

It should be translated to APPROX_PERCENTILE

Official Documentation
https://docs.snowflake.com/en/sql-reference/functions/approx_percentile

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.

2 participants