AWS Certified Data Engineer – Associate (DEA-C01) — Question 189

A data engineer created a table named cloudtrail_logs in Amazon Athena to query AWS CloudTrail logs and prepare data for audits. The data engineer needs to write a query to display errors with error codes that have occurred since the beginning of 2024. The query must return the 10 most recent errors.

Which query will meet these requirements?

Answer options

Correct answer: A

Explanation

Option A is correct because it filters for non-null error codes and retrieves events from 2024, grouping by event name, error code, and error message, while ordering by the total event count in descending order. Option B does not filter for non-null error codes, which is necessary to meet the requirement. Option C orders by event name instead of the total event count, and option D lacks the ordering requirement, which makes A the only suitable choice.