-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
[Sqllab] Error: no such column When there are same fields in two tables with a join #5739
Comments
Which db engine is this? Looks like databases and drivers do different things to manage duplicated column names. |
The workaround is to alias your fields uniquely as in:
|
Thanks. |
@Narcissus7 As Superset wraps the SQL Lab query into a subquery, I don't think there is any way for Superset to select the deduplicated column without explicit aliases as @mistercrunch suggested. One approach would be to somehow reconstruct the the |
@villebro I see. Thanks a lot |
Here's what the query in the explore view looks like SELECT id AS id,
id__1 AS id__1
FROM
(SELECT a.id,
b.id
FROM ab_view_menu a
LEFT JOIN ab_permission_view b ON a.id = b.view_menu_id) AS expr_qry
LIMIT 1000 |
We could try to detect the double underscore |
* [explore flow] handling duplicated column aliases closes #5739 * lint
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
* [explore flow] handling duplicated column aliases closes apache#5739 * lint (cherry picked from commit 75bc501)
Make sure these boxes are checked before submitting your issue - thank you!
Superset version
master
Actual results
but in Explore, can't get the field id__1

Steps to reproduce
Select * [choose two tables with same fields]
Run query
Explore
The text was updated successfully, but these errors were encountered: