laughingman7743 / PyAthenaJDBC

PyAthenaJDBC is an Amazon Athena JDBC driver wrapper for the Python DB API 2.0 (PEP 249).
MIT License
95 stars 31 forks source link

how to use custom credential provider jar with sqlalchemy #132

Open knadigatla opened 3 years ago

knadigatla commented 3 years ago

Hello,

We built a custom credential provider jar for custom authentication to athena. as per the aws documentation mentioned below.

https://aws.amazon.com/blogs/big-data/connect-to-amazon-athena-with-federated-identities-using-temporary-credentials/

but I have passed the extra jar(credential jar) in driver_path along with the athenajdbc jar. like driver_path="<path_to_driver_jar>;<path_to_custom_credentials_jar>" But it is failing and not recognizing the custom class. Should I use a different approach to pass the extra jar?

If I pass only jdbc jar then it is throwing the credential class missing, if I pass both the jars ; separated then it is throwing TypeError: Class com.simba.athena.jdbc.Driver is not found

laughingman7743 commented 3 years ago

It doesn't support loading multiple Jar files, I think it would be better to create a shaded jar(fat jar) file that contains the JDBC driver and custom credential classes and specify them in the driver class path. Alternatively, consider using a library that does not depend on JDBC. https://github.com/laughingman7743/PyAthena

knadigatla commented 3 years ago

It doesn't support loading multiple Jar files, I think it would be better to create a shaded jar(fat jar) file that contains the JDBC driver and custom credential classes and specify them in the driver class path. Alternatively, consider using a library that does not depend on JDBC. https://github.com/laughingman7743/PyAthena

Thanks @laughingman7743 does PyAthena supports custom authentication?(writing our own credential generator class)

laughingman7743 commented 3 years ago

It doesn't support the Java credential provider that you have created on your own. If so, I think you need to use the JDBC version.