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

Presto. Qualify alias name is treated as a special expression #3287

Closed
2 of 3 tasks
bkyryliuk opened this issue Apr 8, 2024 · 4 comments
Closed
2 of 3 tasks

Presto. Qualify alias name is treated as a special expression #3287

bkyryliuk opened this issue Apr 8, 2024 · 4 comments

Comments

@bkyryliuk
Copy link

Before you file an issue

  • Make sure you specify the "read" dialect eg. parse_one(sql, read="spark")
  • Make sure you specify the "write" dialect eg. ast.sql(dialect="duckdb")
  • Check if the issue still exists on main

Fully reproducible code snippet
Please include a fully reproducible code snippet or the input sql, dialect, and expected output.

import sqlglot

asts = sqlglot.parse(q, dialect='presto')
q = """select count(distinct table_a.cola)
from (select * from table_a) alias_b
join
(
  select distinct cola from table_b
    where sku_plan_type = 'BASIC'
    and locale in ('en', 'en_GB')

) qualify
on alias_b.cola = qualify.cola
LIMIT 11"""
asts = sqlglot.parse(q, dialect='presto')

Error:

ParseError: Required keyword: 'this' missing for <class 'sqlglot.expressions.Qualify'>. Line 10, Col: 2.
  ct cola from table_b
    where sku_plan_type = 'BASIC'
    and locale in ('en', 'en_GB')

) qualify
on alias_b.cola = qualify.cola
LIMIT 11

Official Documentation
Please include links to official SQL documentation related to your issue.

@tobymao tobymao closed this as completed in a37d231 Apr 8, 2024
@tobymao
Copy link
Owner

tobymao commented Apr 8, 2024

@bkyryliuk thanks for the report. would appreciate PRs in the future for small things like this.

@bkyryliuk
Copy link
Author

We will do our best, right now I don't have capacity for it / codebase familiarity. Would you still prefer bugs to be filed ?

@tobymao
Copy link
Owner

tobymao commented Apr 8, 2024

yes, as long as the reports contain all the information i need, like documentation, expected behavior, what expected out come is thanks!

@bkyryliuk
Copy link
Author

sounds good, will do

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