Skip to content

INTERNAL_ERROR_QUERY_ENGINE

0

internal error

[ErrorCode: INTERNAL_ERROR_QUERY_ENGINE] Amazon Athena experienced an internal error while executing this query.

**** Query Id: c0183385-43d6-47e7-8274-9a82346d3d85

how did this happen , please help

asked a year ago232 views

2 Answers
0
Accepted Answer

Can you share the query. I suspect it contains multiple joins results in large datasets and eventually requires lot of CPU and memory. Alternatively, it's possible the partitions are not done correctly. Are you able to run other queries on the same data source.

EXPERT

answered a year ago

  • i have found which sentence cause the error, but i can not resolve it.

    select 'xyz' as group_by_id ,array_distinct(flatten(array_agg(adchannel_time))) as adchannel_time from db.table group by 'xyz'

    i guess the function "array_distinct" may cause the error. The column "adchannel_time" 's data type is array<string> .

  • problems resolved, when i downgrade the complexity of the query, it will run normally

0

The INTERNAL_ERROR_QUERY_ENGINE error you're experiencing is an internal Athena error that occurs on the query engine side. This type of error is not typically caused by user input but rather by an issue within Athena's system itself.

There are several possible reasons this could have happened:

  1. Temporary system issue: Sometimes these errors are transient and can be resolved by simply retrying the query.

  2. Query complexity: If your query is particularly complex or resource-intensive, it might be pushing the limits of Athena's query engine.

  3. Data issues: There could be unexpected issues with the data you're querying, such as corrupted files or inconsistencies in the data format.

  4. Service disruption: There might be ongoing issues with the Athena service in your region.

To address this issue, you can try the following steps:

  1. Retry the query: As mentioned, the error might be temporary and resolve itself on a subsequent attempt.

  2. Simplify the query: If possible, try breaking down your query into smaller, simpler parts to identify if a specific section is causing the issue.

  3. Check your data: Ensure that all tables referenced in your query exist and have the expected structure.

  4. Verify permissions: Make sure your IAM user or role has the necessary permissions to access both the source data and the query results location.

  5. Check Athena service status: Look for any reported issues with Athena in your region.

If the problem persists after trying these steps, you should contact AWS support for further assistance. They have access to more detailed logs and can investigate the root cause of the internal error.

Remember, you won't be charged for queries that result in this error, so don't hesitate to retry or experiment with query modifications to resolve the issue.
Sources
ErrorCode: INTERNAL_ERROR_QUERY_ENGINE | AWS re:Post
Athena Query: Encountered INTERNAL_ERROR_QUERY_ENGINE Error | AWS re:Post
ATHENA INTERNAL_ERROR_QUERY_ENGINE | AWS re:Post

answered a year 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.