Search code examples
apache-supersettrinohive-metastore

Trying to connect to TRINO via Apache Superset, failed


apache superset v2.0.0
trino           v398
hive-metastore  v3.1.3

I am attempting to connect apache superset to Trino .. specifically trino which is connected to S3 via the HIVE metastore.. but everything I try is failing.. please advise how to debug

Connection string in Apache Superset

trino://[email protected]:8080/hive

Error

SupersetErrorsException                                                                                                                            
Traceback (most recent call last):                                                                                                                 
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/databases/commands/test_connection.py", line 120, in run                          
    raise DBAPIError(None, None, None)                                                                                                             
sqlalchemy.exc.DBAPIError: (builtins.NoneType) None                                                                                                
(Background on this error at: http://sqlalche.me/e/13/dbapi)                                                                                       
                                                                                                                                                   
The above exception was the direct cause of the following exception:                                                                               
                                                                                                                                                   
Traceback (most recent call last):                                                                                                                 
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask/app.py", line 1517, in full_dispatch_request                                         
    rv = self.dispatch_request()                                                                                                                   
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask/app.py", line 1503, in dispatch_request                                              
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)                                                                   
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 89, in wraps                                
    return f(self, *args, **kwargs)                                                                                                                
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/views/base_api.py", line 113, in wraps                                            
    raise ex                                                                                                                                       
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/views/base_api.py", line 110, in wraps                                            
    duration, response = time_function(f, self, *args, **kwargs)                                                                                   
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/utils/core.py", line 1507, in time_function                                       
    response = func(*args, **kwargs)                                                                                                               
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/utils/log.py", line 245, in wrapper                                               
    value = f(*args, **kwargs)                                                                                                                     
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/views/base_api.py", line 83, in wraps                                             
    return f(self, *args, **kwargs)                                                                                                                
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/databases/api.py", line 709, in test_connection                                   
    TestConnectionDatabaseCommand(g.user, item).run()                                                                                              
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/databases/commands/test_connection.py", line 145, in run                          
    raise DatabaseTestConnectionFailedError(errors) from ex                                                                                        
superset.databases.commands.exceptions.DatabaseTestConnectionFailedError: [SupersetError(message='(builtins.NoneType) None\n(Background on this err
or at: http://sqlalche.me/e/13/dbapi)', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR:
 'error'>, extra={'engine_name': 'Trino', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})] 
2022-10-07 23:58:44,966:WARNING:superset.views.base:SupersetErrorsException                                                                        
Traceback (most recent call last):                                                                                                                 
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/databases/commands/test_connection.py", line 120, in run                          
    raise DBAPIError(None, None, None)                                                                                                             
sqlalchemy.exc.DBAPIError: (builtins.NoneType) None                                                                                                
(Background on this error at: http://sqlalche.me/e/13/dbapi)                                                                                       
                                                                                                                                                   
The above exception was the direct cause of the following exception:                                                                               
                                                                                                                                                   
Traceback (most recent call last):                                                                                                                 
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask/app.py", line 1517, in full_dispatch_request                                         
    rv = self.dispatch_request()                                                                                                                   
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask/app.py", line 1503, in dispatch_request                                              
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)                                                                   
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 89, in wraps                                
    return f(self, *args, **kwargs)                                                                                                                
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/views/base_api.py", line 113, in wraps                                            
    raise ex                                                                                                                                       
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/views/base_api.py", line 110, in wraps                                            
    duration, response = time_function(f, self, *args, **kwargs)                                                                                   
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/utils/core.py", line 1507, in time_function                                       
    response = func(*args, **kwargs)                                                                                                               
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/utils/log.py", line 245, in wrapper                                               
    value = f(*args, **kwargs)                                                                                                                     
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/views/base_api.py", line 83, in wraps                                             
    return f(self, *args, **kwargs)                                                                                                                
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/databases/api.py", line 709, in test_connection                                   
    TestConnectionDatabaseCommand(g.user, item).run()                                                                                              
  File "/home/ubuntu/.local/lib/python3.8/site-packages/superset/databases/commands/test_connection.py", line 145, in run                          
    raise DatabaseTestConnectionFailedError(errors) from ex                                                                                        
superset.databases.commands.exceptions.DatabaseTestConnectionFailedError: [SupersetError(message='(builtins.NoneType) None\n(Background on this err
or at: http://sqlalche.me/e/13/dbapi)', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR:
 'error'>, extra={'engine_name': 'Trino', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]

Solution

  • here's the combination that is working now

    connection string trino://[email protected]:8080/hive

    the key is the trino==0.318.0 pypi library was needed.. there are other issues but I can FINALLY query data in superset to some extent from TRINO