PyAthenaJDBC | Amazon Athena JDBC driver wrapper for the Python DB API | AWS library
kandi X-RAY | PyAthenaJDBC Summary
kandi X-RAY | PyAthenaJDBC Summary
PyAthenaJDBC is an Amazon Athena JDBC driver wrapper for the Python DB API 2.0 (PEP 249).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- The column description
- Returns the name for the given type code
- Return the value for the given type
- Visit a create table
- Generate post - create statement
- Return the type of a datetime
- Return a time stamp
- Visit VARBINARY
- Return binary type
- Visitor for floating point types
- Determine type
- Visits a numeric type
- Return an astroid Decimals node as string
- Format a query
- Get the mapping for a given type
- Convert a result_set into a result set
- Set a converter function
- Gets the code for the given type
- Downloads the JDBC driver
- Return type of binary
- Return nclob
- Return the type of a clob
PyAthenaJDBC Key Features
PyAthenaJDBC Examples and Code Snippets
Community Discussions
Trending Discussions on PyAthenaJDBC
QUESTION
I run an automated python job on an EMR cluster that updates Amazon Athena Tables.
It was running well until few days ago (on python 2.7 and 3.7). Here is the script:
...ANSWER
Answered 2019-Jun-25 at 13:59Got the same issue today. Try to downgrade JPype1 to 0.6.3. JPype1 released 0.7.0 today, which is not compatible with old interfaces.
QUESTION
I'm trying to connect to Athena using pyathenajdbc.connect(). I have AWS credentials setup via Multi-factor Authentication. When I don't include the AWS Token in connection string I get following error.
athena_conn = connect(access_key=AWS_KEY_ID, secret_key=AWS_SECRET, s3_staging_dir='s3://abc-pqr-xyz/processed/athena-outputs/',region_name=REGION)
EROR: pyathenajdbc.error.DatabaseError: The security token included in the request is invalid. (Service: AmazonAthena; Status Code: 400; Error Code: UnrecognizedClientException; Request ID: 0d488c0b-1eed-11e7-bad8-711e54af6b73)
When I include the AWS Token in connection string I get following error -->
athena_conn = connect(access_key=AWS_KEY_ID, secret_key=AWS_SECRET, token=AWS_SESSION_TOKEN, s3_staging_dir='s3://abc-pqr-xyz/processed/athena-outputs/',region_name=REGION)
ERROR: pyathenajdbc.error.DatabaseError: The security token included in the request is invalid. (Service: AmazonAthena; Status Code: 400; Error Code: UnrecognizedClientException; Request ID: 91751051-1eed-11e7-8347-153dfe3d84a6)
Does anyone know what is wrong here??
Here is my entire code.
...ANSWER
Answered 2017-Apr-12 at 12:42The issue is not straightforward but i'm guessing it has something to do with your credentials. You should investigate a bit: try printing your keys and verify if they are valid or not.
Here is an alternative that I use to input my credentials :
QUESTION
I am trying to use the PyAthenaJDBC library to make a python script that will query an S3 bucket using Athena. The library is pretty great but I'm having issues with formatting.
I'm constructing the queries as strings in a separate function and passing the query string back to cursor.execute(query)
.
The query string has quotes in it, and looks like this:
...ANSWER
Answered 2017-Apr-22 at 05:24If the query is used as a string to be formatted, you need to double any %
characters you want to survive as literal %
characters.
Instead of WHEN elb_response_code LIKE '5%' THEN 1
, use WHEN elb_response_code LIKE '5%%' THEN 1
. After the line you indicate in formatter.py runs, %%
will have been transformed into a single %
.
QUESTION
I am using the python module called PyAthenaJDBC in order to query Athena using the provided JDBC driver. Here is the link : https://pypi.python.org/pypi/PyAthenaJDBC/
I have been facing some persistent issue. I keep getting this java error whenever I use the Athena connection twice in a row.
As a matter of fact, I was able to connect to Athena, show databases, create new tables and even query the content. I am building an application using Django and running its server to use Athena However, I am obliged to re-run the server in order for the Athena connection to work once again,
Here is a glimpse of the class I have built
...ANSWER
Answered 2017-Mar-21 at 14:43Update: After posting the issue in github, the author solved this problem and released a new version that works perfectly. It was a multi-threading problem with JPype.
Question answered!
ref : https://github.com/laughingman7743/PyAthenaJDBC/pull/8
QUESTION
I am trying to connect to AWS Athena using python. I am trying to use pyathenajdbc to achieve this task. The issue I am having is obtaining a connection. When I run the code below, I receive an error message stating it cannot find the AthenaDriver. ( java.lang.RuntimeException: Class com.amazonaws.athena.jdbc.AthenaDriver not found). I did download this file from AWS and I have confirmed it is sitting in that directory.
...ANSWER
Answered 2017-Mar-27 at 09:19Try this :
QUESTION
I am using the python module called PyAthenaJDBC in order to query Athena using the provided JDBC driver. Here is the link : https://pypi.python.org/pypi/PyAthenaJDBC/
The connection is established successfully, the queries are working as well (Show databases, show tables, Select ... ) However, whenever I try to define a custom table using Hive arguments such as 'ROW FORMAT SERDE..' It's not working anymore, Here is my code :
...ANSWER
Answered 2017-Mar-15 at 11:29Your query is malformed.
It is due to this line:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PyAthenaJDBC
You can use PyAthenaJDBC like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page