You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/07/18 18:07:27 UTC

[GitHub] [superset] z6cr0b3rts opened a new issue, #20752: Trino Engine Specs Producing Duplicate Table/View Items in SQL Lab UI

z6cr0b3rts opened a new issue, #20752:
URL: https://github.com/apache/superset/issues/20752

   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](https://github.com/apache/superset/blob/510c1c4817024af051cc30f315a042c282dbd3b2/superset/db_engine_specs/presto.py#L268) ... however may not have been addressed as part of [this refactoring](https://github.com/apache/superset/pull/20434).
   
   Ultimately, it looks like in the [db_engine_specs/trino.py](https://github.com/apache/superset/blob/master/superset/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)
   `
   
   #### How to reproduce the bug
   
   1. Go to Data -> Databases. 
   2. Click button to Add Database "+ Database"
   3. Choose Trino from supported databases and add a Trino datasource.
   4. After succesfully adding a Trino datasource, navigate to SQL Lab -> SQL Editor.
   5. In the database dropdown, choose the Trino datasource you added. 
   6. Refresh the schema drop down 
   7. 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
   
   (please complete the following information):
   
   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](https://github.com/apache/superset/blob/92f3621c754a4f3ddb99285aad273296be26567e/superset/db_engine_specs/trino.py#L38) inherits from the [Presto engine spec](https://github.com/apache/superset/blob/master/superset/db_engine_specs/presto.py) 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.   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dungdm93 commented on issue #20752: Trino Engine Specs Producing Duplicate Table/View Items in SQL Lab UI

Posted by GitBox <gi...@apache.org>.
dungdm93 commented on issue #20752:
URL: https://github.com/apache/superset/issues/20752#issuecomment-1192684173

   #20152


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Trino Engine Specs Producing Duplicate Table/View Items in SQL Lab UI [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #20752:
URL: https://github.com/apache/superset/issues/20752#issuecomment-1936446884

   Based on the above thread and PR, I'm assuming this is solved. Correct me if I'm mistaken!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Trino Engine Specs Producing Duplicate Table/View Items in SQL Lab UI [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #20752: Trino Engine Specs Producing Duplicate Table/View Items in SQL Lab UI
URL: https://github.com/apache/superset/issues/20752


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] z6cr0b3rts commented on issue #20752: Trino Engine Specs Producing Duplicate Table/View Items in SQL Lab UI

Posted by GitBox <gi...@apache.org>.
z6cr0b3rts commented on issue #20752:
URL: https://github.com/apache/superset/issues/20752#issuecomment-1192999704

   Thanks... I'll take another look and report back. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] john-bodley commented on issue #20752: Trino Engine Specs Producing Duplicate Table/View Items in SQL Lab UI

Posted by GitBox <gi...@apache.org>.
john-bodley commented on issue #20752:
URL: https://github.com/apache/superset/issues/20752#issuecomment-1192950036

   The issue may be that the TrinoEngineSpec might need to override—reverting to the base implementation—some of the Presto methods.
   
   I do know that the PyHive Presto SQLAlchemy dialect fetches both tables and views for the [get_table_names](https://github.com/dropbox/PyHive/blob/master/pyhive/sqlalchemy_presto.py#L191) method.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org