-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
read_database_uri triggers ShapeError since 1.18 when querying 2 tables joined with same columns names in the 2 tables #20616
Comments
Looking at the referenced DuckDB report/example it seems that we should actually be raising a (I was able to replicate the exact error via some local queries using |
I am not sure this a problem of duplicate column name as they are renamed with an 'as' clause. So if we join two tables with both 'similar_name_field' in each of them and we select t1.similar_name_field as 'field_renamed_from_t1',
t2.similar_name_field as 'field_renamed_from_t2'
from t1 join t2; A dataframe of width 1 will be fetched instead of 2 since v1.18. I can't hardly believe this is the expected behavior and should trigger a DuplicateError. |
It will only trigger a If you can clarify your example above (which isn't reproducible as the uri is just "uri", and there's nothing to connect to ;) then I can take another look, but the specific Note that if the query returns duplicate column names despite your aliasing then this is not an error on our side, it would be an error on the database side, and raising |
Hello Alexander, uri is a postgres database The linked issue to duckdb is indeed not the same as they are not using aliases and therefore duplicating columns. |
I will try to make a more reproducible case and debug with more info ! |
There was indeed duplicates in my aliases 🤡 Thanks a lot ! |
Lol... well, in the next release we'll actually tell you which column it is in the error msg 😁
No problem; thanks for taking the time to make an Issue. |
Checks
Reproducible example
Log output
polars.exceptions.ShapeError: X+1 column names provided for a DataFrame of width X
Issue description
Bug introduced in 1.18
Only one column returned when same names on 2 joined tables
Cross referencing similar report : duckdb/duckdb#15528
Expected behavior
2 columns returned
Installed versions
Bug exists on 1.18 and 1.19
No issue on 1.17.1
The text was updated successfully, but these errors were encountered: