-
Notifications
You must be signed in to change notification settings - Fork 221
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
Table name and transform name collisions #3271
Comments
Thanks @FinnRG . Yes, repro-ed. And a particularly bad error message... As a workaround in the meantime, this works:
WITH table_0 AS (
SELECT
*
from
group
)
SELECT
*
FROM
table_0
-- Generated by PRQL compiler version:0.9.3 (https://prql-lang.org) |
This is expected behavior. An unfortunate one, but a compound of how we do name resolution and table inference. So the problem is that identifier The solution is this:
... except that now, this will compile to The real solution is:
... which bypasses |
Completely abstract of the current implementation, I do think that's a bit unfriendly / inconsistent. I recognize we do need to make some tradeoffs because of PRQL's use of "bare words" — there'll always be some ambiguity. But (thinking on the fly here, not super confident):
How about we extend the We'd need to discriminate between scopes:
(other languages have slightly complicated rules around this, e.g. |
Could I open a PR to add the |
Thanks for the offer re a PR for the docs — we'd def accept it. If we do that, would be great to link to this issue and caveat — we don't think the current state is great, but this is a workaround... |
That tells me that we should either:
|
WDYT about having something like
But is there a need to discard the
This was the very first proposal for PRQL — no |
Coming late to this discussion but will give it some thought as well. |
What happened?
I have a table named
group
, which I tried to query. I tried using backticks (as suggested in the docs: https://prql-lang.org/book/reference/stdlib/transforms/from.html), which doesn't seem to work.PRQL input
SQL output
Expected SQL output
No response
MVCE confirmation
Anything else?
Exact error:
The text was updated successfully, but these errors were encountered: