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

SQL: Allow "AS" table alias expressions #3065

Closed
ukclivecox opened this issue Oct 17, 2024 · 0 comments · Fixed by #3066
Closed

SQL: Allow "AS" table alias expressions #3065

ukclivecox opened this issue Oct 17, 2024 · 0 comments · Fixed by #3066
Assignees
Labels
enhancement New feature or request sql

Comments

@ukclivecox
Copy link

ukclivecox commented Oct 17, 2024

Is your feature request related to a problem?

Example:

import daft

df = daft.from_pydict({"a": [0, 2, 3, 11, 12]})

daft.sql("select * from df where df.a > 3").show()

daft.sql("select * from df as foo where foo.a > 3").show()

The first sql works but the second gives a Table not found: foo exception

Describe the solution you'd like

Support schema.table AS identifier expressions. Most SQL also allows AS to be optional: see here and for postgres

Describe alternatives you've considered

In my case the SQL is autogenerated so would need some effort to remove table aliases where ever they can be used.

Additional Context

version 0.3.8

Would you like to implement a fix?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sql
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants