[ErrorCode: INTERNAL_ERROR_QUERY_ENGINE]

0

I am running query in athena engine 3.0 and getting the error [ErrorCode: INTERNAL_ERROR_QUERY_ENGINE] Amazon Athena experienced an internal error while executing this query.

Query is like :

/* gtbm 2023-10-29 */ CREATE TABLE dataengg.gtbm_20231028_GTBM_NJ_Metro_7_test WITH ( external_location = 's3://quadrant-poc/delivery/year=2023/month=10/day=28', format = 'JSON', parquet_compression = 'GZIP', bucket_count = 500, bucketed_by = ARRAY['device_id']) AS WITH subset AS ( SELECT device_id, latitude, longitude, horizontal_accuracy, timestamp, country FROM db.db_1 WHERE ( year=2023 and month=10 and day=28 ) AND ( source_id IN ( '01' ) ) AND ( country IN ( 'SG' ) )

)
SELECT device_id,
        latitude,
        longitude,
        horizontal_accuracy,
        timestamp,
        country
FROM
    (SELECT *,
        row_number() OVER (partition by dedup_id) AS seqnum
    FROM subset)
WHERE seqnum = 1

Even i am trying to run simple query also than also getting error And If query ran around 40 min than getting this error EXCEEDED_TIME_LIMIT: Query exceeded the maximum planning time limit of 40.00m

asked 6 months ago255 views
1 Answer
0

Trying to understand your code snippet , and maybe the formatting is throwing me off , but I believe you should be having two queries.

The first one should create the table pointing to the S3 files. And second query reading the table and applying your logic.

profile pictureAWS
answered 6 months ago
  • Yes, there is two queries. Even i tried to run simple select query with all partition but getting same error. Is this Bug in Athena Engine 3.0

  • I see you are creating a table dataengg.gtbm_20231028_GTBM_NJ_Metro_7_test but that table is not being used subsequently. Instead I see tbale db.db_1 being used. Sorry but I cannot understand your question properly.

    Can I request you to separate out the two queries, and show result of execution of each query individually.

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.

Guidelines for Answering Questions