提问人:Max test 提问时间:10/1/2022 更新时间:10/13/2023 访问量:523
无法将超集连接到 dremio
Can't connect superset to dremio
问:
我正在按照此处(https://superset.apache.org/docs/installation/installing-superset-using-docker-compose/)的说明使用 docker-compose-non-dev.yml 使用 docker-compose 运行 apache-superset。
我还将sqlalchemy-dremio添加到superset/docker/requirements-local.txt,以便添加此处提到的dremio支持(https://superset.apache.org/docs/databases/docker-add-drivers)
对于 dremio,我有一个单独的容器在 dremio/dremio-oss 映像上运行,使用
docker run -p 9047:9047 -p 31010:31010 -p 45678:45678 -p 32010:32010 dremio/dremio-oss
然后使用 localhost:9047 的 Web 界面在 dremio 中创建一个帐户
但是当我尝试将 dremio 添加为超集中的数据库时,出现以下错误 在按下测试连接时,出现以下错误
我使用的连接字符串是
dremio+flight://dremio:[email protected]:32010/dremio;SSL=0
起初我以为这可能是网络错误或 dremio 中的错误,但我可以使用此处的 python 脚本连接到 dremio https://github.com/dremio-hub/arrow-flight-client-examples/blob/main/python/example.py
python example.py -host host.docker.internal -query 'SELECT 1'
此脚本在使用 localhost 的容器外部host_os以及使用 host.docker.internal 作为主机的 superset_app 容器内部成功运行。因此,我不认为这是网络配置问题,这也证实了sqlalchemy-dremio包已正确安装在超集容器中。
下面是容器中此错误的 docker 日志superset_app
2022-09-30 16:34:09,635:WARNING:superset.views.base:SupersetErrorsException
Traceback (most recent call last):
File "/app/superset/databases/commands/test_connection.py", line 123, in run
raise DBAPIError(None, None, None)
sqlalchemy.exc.DBAPIError: (builtins.NoneType) None
(Background on this error at: https://sqlalche.me/e/14/dbapi)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/decorators.py", line 89, in wraps
return f(self, *args, **kwargs)
File "/app/superset/views/base_api.py", line 114, in wraps
raise ex
File "/app/superset/views/base_api.py", line 111, in wraps
duration, response = time_function(f, self, *args, **kwargs)
File "/app/superset/utils/core.py", line 1572, in time_function
response = func(*args, **kwargs)
File "/app/superset/utils/log.py", line 244, in wrapper
value = f(*args, **kwargs)
File "/app/superset/views/base_api.py", line 84, in wraps
return f(self, *args, **kwargs)
File "/app/superset/databases/api.py", line 708, in test_connection
TestConnectionDatabaseCommand(item).run()
File "/app/superset/databases/commands/test_connection.py", line 148, in run
raise DatabaseTestConnectionFailedError(errors) from ex
superset.databases.commands.exceptions.DatabaseTestConnectionFailedError: [SupersetError(message='(builtins.NoneType) None\n(Background on this error at: https://sqlalche.me/e/14/dbapi)', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Dremio', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]
***************
['UID=dremio', 'PWD=dremio123', 'HOST=host.docker.internal', 'PORT=32010', 'Schema=dremio', 'SSL=0']
***************
答:
确保您安装的是最新版本的 。您可能需要从源代码安装,因为没有相应地更新(大约在撰写本文时)。您还需要向 添加一些基本函数。请看以下问题: https://github.com/narendrans/sqlalchemy_dremio/issues/20sqlalchemy_dremio
setup.py
SQLAlchemy
sqlalchemy_dremio
评论