【问题标题】:Cant connect to superset using athena database无法使用雅典娜数据库连接到超集
【发布时间】:2018-09-09 18:07:16
【问题描述】:

我是超集的新手。 转到 Sources > 数据库以建立与我的 athena 的新连接。

我已经下载了 JDBC 驱动并写了以下连接线:

awsathena+jdbc://AKIAJ2PKWTZYAPBYKRMQ:xxxxxxxxxxxxxxx@athena.us-east-1.amazonaws.com:443/default?s3_staging_dir='s3://aws-athena-query-results-831083831535-us-east- 1/' 作为 SQLAlchemy URI。第一个参数是访问密钥,第二个是密钥(为了隐私做了一些修改)

我收到以下错误:

ERROR: {"error": "Connection failed!\n\nThe error message returned was:\nCan't load plugin: sqlalchemy.dialects:awsathena.jdbc"}

非常感谢您的支持,因为我真的希望在我的数据库上使用超集来探索开源可视化。

谢谢, 拉维

【问题讨论】:

  • 您永远不应该发布您的凭据。

标签: python sqlalchemy amazon-athena superset apache-superset


【解决方案1】:

根据Superset documentation,您至少需要对 s3_staging_dir 进行转义/编码,即,

s3://... -> s3%3A//...

您是否遵循了这一步?

【讨论】:

    【解决方案2】:

    如果你确定你在启动超集时在同一个 python 环境中完成了pip install "PyAthenaJDBC>1.0.9"。尝试在相同的环境中重新启动 Superset。

    【讨论】:

      【解决方案3】:

      就我而言,问题在于aws_secret_keys3_staging_dir 中的特殊字符。我通过将quote_plus 方法的输出放入URI 中解决了这个问题。不需要引号。

      from urllib.parse import quote_plus
      secretkey = quote_plus(aws_secret_access_key) 
      loc = quote_plus(s3_staging_dir)
      

      此外,确保 schema_name(即数据库名称)已存在于 s3 路径中。希望对您有所帮助!

      【讨论】:

        猜你喜欢
        • 2021-06-14
        • 2021-01-27
        • 1970-01-01
        • 1970-01-01
        • 2023-01-04
        • 1970-01-01
        • 1970-01-01
        • 2018-10-19
        • 2021-01-29
        相关资源
        最近更新 更多