简体   繁体   中英

Cant connect to superset using athena database

I am new to superset. Going to Sources > Databases for a new connection to my athena.

I have downloaded JDBC driver and writing following connection line:

awsathena+jdbc://AKIAJ2PKWTZYAPBYKRMQ:xxxxxxxxxxxxxxx@athena.us-east-1.amazonaws.com:443/default?s3_staging_dir='s3://aws-athena-query-results-831083831535-us-east-1/' as SQLAlchemy URI. First parameter being access key and 2nd being secret key(Modified a bit for privacy)

I am getting error as:

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

Would be very thankful for support as I really wish to explore the open source visualisation using superset on my databases.

Thanks, Ravi

As per Superset documentation , you need to escape/encode at least the s3_staging_dir, ie,

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

Have you followed that step?

If you are sure you have done pip install "PyAthenaJDBC>1.0.9" in the same python environment as you start your superset. Try restarting Superset in the same environment.

In my case problem was with the special characters in the aws_secret_key and s3_staging_dir . I solved it by putting the output of quote_plus methods into the URI. No quotes were required.

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

Further, make sure the schema_name (ie database name) already exists in the s3 path. Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM