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

Snowflake dialect incorrectly translates startswith #1998

Closed
wezham opened this issue Aug 7, 2023 · 0 comments
Closed

Snowflake dialect incorrectly translates startswith #1998

wezham opened this issue Aug 7, 2023 · 0 comments

Comments

@wezham
Copy link
Contributor

wezham commented Aug 7, 2023

The following incorrectly translates the snowflake function startswith to starts_with

The docs indicate the method name as https://docs.snowflake.com/en/sql-reference/functions/startswith

Code snippit:

from sqlglot import parse_one


res = parse_one("SELECT * FROM logs where startswith(table, 'test')", read="snowflake")
print(res.sql(dialect="snowflake"))

Output:

SELECT * FROM logs WHERE STARTS_WITH(table, 'test')

Therefore the expected output would be:

SELECT * FROM logs WHERE STARTSWITH(table, 'test')
@tobymao tobymao closed this as completed in d219a65 Aug 7, 2023
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

No branches or pull requests

1 participant