-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
Exploration creation fails for tables with weird names #4088
Comments
I was intrigued by this bug so I spent a little time troubleshooting it. I had an easy time reproducing it, so I'm removing the PostgreSQL was hitting an "ambiguous column reference" error when attempting to run this SQL: SQLWITH
anon_3 AS (
SELECT
public."Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - savings_clea".id AS "Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - savings_clea_id",
public."Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - savings_clea".yes AS "Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - savings_clea_yes"
FROM public."Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - savings_clea"
),
anon_2 AS (
SELECT
anon_3."Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - savings_clea_id" AS "Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - saving_1",
anon_3."Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - savings_clea_yes" AS "Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - saving_2"
FROM anon_3
ORDER BY
anon_3."Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - savings_clea_id" ASC
),
anon_1 AS (
SELECT
anon_2."Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - saving_1" AS "Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - saving_1",
anon_2."Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - saving_2" AS "Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - saving_2"
FROM anon_2
LIMIT %(param_1)s
)
SELECT
anon_1."Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - saving_1",
anon_1."Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - saving_2"
FROM anon_1 Here's why
It seems to me that we'll need to eliminate concatenation within aliases. In this case, the offending code seems likely to be python, but I've not traced it down fully. I think it's probably somewhere in There could be other cases of concatenation like this too. For example, here's some code that I've written which has concatenation inside an alias. I have a hunch there is a bug here too, though I've not attempted to identify any repro steps yet. Nonetheless, it would be quite tricky to eliminate the concatenation from that code! |
To Reproduce
Sheet 1-Acct Statement_curr_sav_jan1-24-oct10-24 - savings_clear
Additional context
The text was updated successfully, but these errors were encountered: