-
Notifications
You must be signed in to change notification settings - Fork 148
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
[BUG] Runtime exception thrown if duplicate name in SELECT items #785
Comments
Just faced this in another context:
With the same stacktrace. |
Yes, I think it's the same cause here. Not sure what's use case. But I think we'd better to throw semantic exception with clear message. |
I think we should throw no exception.
Exception happens in |
Just checked a PoC by adding a zero-based counter to the map keys, it works:
It is not returned by user (why? how?), but we need more investigation. Maybe this fix will be easier.
|
Yes, I tested other database and they have no problem with such kind of query. I think we can add the support if this can be quick fixed, otherwise just improve the error. |
As a work around, aliasing the duplicate expressions works -- This will be relevant for JOIN support (#49) because the joined tables can have columns with the same name. IIRC, SQL Server resolved this by appending |
What is the bug?
Currently duplicate name in SELECT statement is not supported and runtime exception is thrown at execution time.
How can one reproduce the bug?
Steps to reproduce the behavior:
What is the expected behavior?
Either semantic check performed and semantic exception thrown with clear error message
Or support this case as other database if needed.
What is your host/environment?
Do you have any screenshots?
N/A
Do you have any additional context?
Tested MySQL and SQLServer. Both has same behavior as below:
Exception stacktrace:
The text was updated successfully, but these errors were encountered: