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

Cannot convert IS TRUE or IS FALSE from Redshift to Trino #1740

Closed
pangyifish opened this issue Jun 7, 2023 · 0 comments
Closed

Cannot convert IS TRUE or IS FALSE from Redshift to Trino #1740

pangyifish opened this issue Jun 7, 2023 · 0 comments
Assignees

Comments

@pangyifish
Copy link

sql = """SELECT a from (select true as a) where a is true"""
converted_sql = sqlglot.transpile(sql, read="redshift", write="trino")[0]
print(converted_sql)

SELECT a FROM (SELECT TRUE AS a) WHERE a IS TRUE
Trino error: mismatched input 'TRUE'. Expecting: 'DISTINCT', 'NOT', 'NULL'

a fix could be: replacing "is true" with ""; "is false" with "not"

@tobymao tobymao self-assigned this Jun 7, 2023
@tobymao tobymao closed this as completed in 0cc09cf Jun 7, 2023
adrianisk pushed a commit to adrianisk/sqlglot that referenced this issue Jun 21, 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

2 participants