You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After adding Trino as a source database, the user could experience error messages in the SQL Lab UI due to duplicated table/view names in the SQL Lab SQL Editor "See Table Schema" drop down. I believe this is related to a similar issue that was handled for Presto ... however may not have been addressed as part of this refactoring.
Ultimately, it looks like in the db_engine_specs/trino.py the functions get_table_names() and get_view_names() both return the same identical list which generates duplicates in the UI. This could be due to the fact that the following SQL Alchemy example returns the exact same list for both tables and views when working with Trino (tables will have same elements as views):
from sqlalchemy import create_engine
from sqlalchemy import inspect
create engine from a URL and params
create inspector for engine
tables = inspector.get_table_names(schema)
views = inspector.get_view_names(schema)
I believe this has been handled for Presto but not Trino. The Trino engine spec inherits from the Presto engine spec however the Trino spec overrides the get_table_names and get_view_names functions by calling the default functions on the base engine object. One option might be to leverage the functions in the Presto spec. Another option might be to code the Trino functions similarly to what has been done for Presto.
How to reproduce the bug
Go to Data -> Databases.
Click button to Add Database "+ Database"
Choose Trino from supported databases and add a Trino datasource.
After succesfully adding a Trino datasource, navigate to SQL Lab -> SQL Editor.
In the database dropdown, choose the Trino datasource you added.
Refresh the schema drop down
Observe duplicates and potentially error messages in "See Table Schema" drop down.
Expected results
Would not expect to see duplicate entries for each table/view in the See Table Schema dropdown.
Actual results
Duplicate entires for each table/view in the See Table Schema dropdown.
Screenshots
Coming soon.
Environment
Coming soon.
Checklist
Make sure to follow these steps before submitting your issue - thank you!
I have checked the superset logs for python stacktraces and included it here as text if there are any.
I have reproduced the issue with at least the latest released version of superset.
I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
I believe this has been handled for Presto but not Trino. The Trino engine spec inherits from the Presto engine spec however the Trino spec overrides the get_table_names and get_view_names functions by calling the default functions on the base engine object. One option might be to leverage the functions in the Presto spec. Another option might be to code the Trino functions similarly to what has been done for Presto.
The text was updated successfully, but these errors were encountered:
After adding Trino as a source database, the user could experience error messages in the SQL Lab UI due to duplicated table/view names in the SQL Lab SQL Editor "See Table Schema" drop down. I believe this is related to a similar issue that was handled for Presto ... however may not have been addressed as part of this refactoring.
Ultimately, it looks like in the db_engine_specs/trino.py the functions get_table_names() and get_view_names() both return the same identical list which generates duplicates in the UI. This could be due to the fact that the following SQL Alchemy example returns the exact same list for both tables and views when working with Trino (tables will have same elements as views):
I believe this has been handled for Presto but not Trino. The Trino engine spec inherits from the Presto engine spec however the Trino spec overrides the get_table_names and get_view_names functions by calling the default functions on the base engine object. One option might be to leverage the functions in the Presto spec. Another option might be to code the Trino functions similarly to what has been done for Presto.
How to reproduce the bug
Expected results
Would not expect to see duplicate entries for each table/view in the See Table Schema dropdown.
Actual results
Duplicate entires for each table/view in the See Table Schema dropdown.
Screenshots
Coming soon.
Environment
Coming soon.
Checklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
I believe this has been handled for Presto but not Trino. The Trino engine spec inherits from the Presto engine spec however the Trino spec overrides the get_table_names and get_view_names functions by calling the default functions on the base engine object. One option might be to leverage the functions in the Presto spec. Another option might be to code the Trino functions similarly to what has been done for Presto.
The text was updated successfully, but these errors were encountered: