I have a query which runs on Athena (directly) in 43 second by scanning 90GB data. I then use pyathena to run the same query (I use it in jupyter notebook on EMR) and it just doesn't finish running (and never returns any results). I have tested it for smaller queries (by placing limit 100) and it works. Is there any reason why pyathena is much slower than running queries directly on Athena?
Why pyathena doesn't work on longer running queries while Athena runs them?
1.8k Views Asked by Reyhaneh At
1
There are 1 best solutions below
Related Questions in AMAZON-ATHENA
- How can I join data to my table that isn't available for everyone without losing results?
- How do I change the data type in a Glue Crawler?
- How can I determine the column level differences between 2 tables?
- How to test Glue jobs and Athena queries locally on dummy data?
- AWS Athena: how to use LIKE in the query
- Using map_agg with order in Athena Presto
- Using Lambda function to create prefixes/folder like Athena when doing query
- How to register a UDF in AWS Athena?
- View uses get_json_object fails in Athena, but works in Databricks
- AWS Glue table schema comments vs no comments
- Trino/Presto SQ: Replace NULL with a value only if the NULL comes after the first non-NULL value in the group
- Programatically querying Delta Table via Athena is failing
- Submit multiple SQL queries in a dynamic way
- How do I make the rounding function of athena match redshift?
- Aws Athena SQL Query is not working in Apache spark
Related Questions in PYATHENA
- How can I pass values for operator parameters from a python function?
- SQL Alchemy ORM Query Does not Include Inner Join Condition
- How to Make Sure SQL Alchemy ORM Translates Each Numerical Object to Raw Query Correctly?
- pyathena returns columns name and value separately
- Catch AWS's TooManyRequestsException when using Pyathena
- AWS Athena is giving multiple "Connection pool is full, discarding connection" warnings while firing queries from a pyathena package
- raise NoCredentialsError() botocore.exceptions.NoCredentialsError: Unable to locate credentials while connecting S3 using Athena
- PyAthena - Invalid length for parameter RoleArn
- Sagemaker Spark Session - Import aws athena table
- Running Great Expectations in AWS Athena
- Getting the following error: AttributeError: 'Engine' object has no attribute '_instantiate_plugins', when connect langchain.SQLDatabase to AWS Athena
- In Pyathena can you insert multiple values(Dates) into a SQL parameter?
- PyAthena parses an ARRAY<VARCHAR> column correctly but the result is a string
- ModuleNotFoundError: No module named 'pyathena' when running AWS Glue Job
- Running synchronized aws athena queries
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I guess you are using the fetchall api.
The fetchall method is using fetchone until no more results and that why it take such long time.
You can use the cursor.output_location to get the csv results file Athena creates to read the results (with boto3 for example):
In addition in the next versions of pyathena you will able to read the results to pandas dataframe by using as_pandas api which reads the file from s3.