Skip to content

Athena Query Internal Error

0

Hello,

I have been using Athena to query json document from s3 bucket and I got below error while executing the query,

[ErrorCode: INTERNAL_ERROR_QUERY_ENGINE] Amazon Athena experienced an internal error while executing this query. Please contact AWS support for further assistance. You will not be charged for this query. We apologize for the inconvenience. This query ran against the "pc_slc_smtt_sustainability_db_prod" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: 3e3e22c7-76c9-46fb-9d66-2d464a2b67a3

I do not understand what is the issue causing this?

2 Answers
0

The issue may cause by having the reserved keywords when you run the query, here is a link to the reserved keywords and examples to run it. https://docs.aws.amazon.com/athena/latest/ug/reserved-words.html

Also, please check your Athena engine version(https://docs.aws.amazon.com/athena/latest/ug/engine-versions-changing.html) as Athena keep releasing new engine for better performance, some syntax may not work with newer version, here is more details about the new engine improvements.(https://docs.aws.amazon.com/athena/latest/ug/engine-versions-reference.html)

Please post your query here for further investigate.

Thanks,

AWS
answered 4 years ago
  • Please find the Query: SELECT "loadtime", "tcreferenceid", "lotno", "productname", "tradename", "inspectionbody", "seller", "buyer", "consignee", "countryofdispatch", "lotweightinkgs", "netweightinkgs", "certificationtype", "tcfilename", "tcfilepath" FROM "AwsDataCatalog"."pc_slc_smtt_sustainability_db_prod"."tc_view"

    Error: [ErrorCode: INTERNAL_ERROR_QUERY_ENGINE] Amazon Athena experienced an internal error while executing this query. Please contact AWS support for further assistance. You will not be charged for this query. We apologize for the inconvenience. This query ran against the "pc_slc_smtt_sustainability_db_prod" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: 29309551-077f-48d7-be8c-4c76b3b03473

0

Immediate Checks:

Verify you have the correct permissions for this specific database Check if other queries against this database work Confirm the table(s) you're querying exist in this database using:

SHOW TABLES IN pc_slc_smtt_sustainability_db_prod;

Database-Specific Checks:

Verify the database location in S3 Check if any partitions need to be refreshed:

MSCK REPAIR TABLE yourtablename;

Try a simple SELECT on the table:

SELECT * FROM yourtablename LIMIT 5;

Query-Specific Actions:

Share your query for review (you can redact sensitive information) Try breaking down the query into smaller parts Check for any special characters or encodings that might cause issues Next Steps:

Document the Query ID: 3e3e22c7-76c9-46fb-9d66-2d464a2b67a3 Contact AWS Support with: The full query The database name: pc_slc_smtt_sustainability_db_prod Any recent changes to the database or tables The error message and Query ID

AWS
answered 8 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.