Before loading a new dataset, an engineer wants to quickly check for nulls, duplicate IDs and out-of-range values using SQL on the files in S3. What is a quick way?
- Exam domain
- Data Operations and Support22% of the exam
- Difficulty
- Easy
- In this mock
- 21 questions on this domainPractise this domain
Why the exam asks this
Task Statement 3.2: Analyze data by using AWS services.
Objective in the exam guide: Verify and clean data (for example, Lambda, Athena, QuickSight, Jupyter Notebooks, Amazon SageMaker Data Wrangler).
Catching bad data before it is loaded is far cheaper than cleaning it out of reports. Quick SQL checks are the fastest first pass.
Why A is the answer
Query the data with Amazon Athena, using COUNT, GROUP BY and WHERE checks
Athena runs ad hoc SQL on S3 data, which makes quick data verification easy.
Remember: Verify new data with quick SQL checks before loading.
How it works
Amazon Athena runs SQL directly on files in S3, with no loading step.
Simple queries reveal data problems: counts of nulls, grouped counts that expose duplicates, and range checks.
Checks that matter can later become automated quality rules.
Clues in the question
The words that point to the answer, and what each one tells you.
- Quickly check using SQL on the files in S3
- Athena.
In detail
- Data Wrangler, notebooks and DataBrew are other ways to verify and clean data.
- Checks that pass can become automated rules later.
Side by side with look-alikes
| Check | SQL pattern |
|---|---|
| Nulls | COUNT(*) WHERE col IS NULL |
| Duplicates | GROUP BY id HAVING COUNT(*) > 1 |
| Out of range | WHERE amount < 0 |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Query the data with Amazon Athena, using COUNT, GROUP BY and WHERE checksRight
Verify new data with quick SQL checks before loading.
B. Load it into production first and see what breaksWrongMost tempting
Loading first spreads bad data downstream.
Why it tempts: It finds problems eventually. But it spreads bad data into reports and other systems first.
C. Open each file in a text editorWrong
Text editors do not scale to large files.
D. Ask users to report problemsWrong
User reports come far too late.
In practice
- Save the checks as named queries for reuse.
Use case
An illustrative scenario, not a real incident.
A GROUP BY on customer_id finds 312 duplicate IDs before the data reaches the warehouse.
See how it works
flowchart LR
N["New files in S3"] --> Q["Athena checks: nulls, duplicates, ranges"]
Q --> P{"All pass?"}
P -->|"Yes"| L["Load"]
P -->|"No"| F["Fix or reject"]How to read this chart
- "New files in S3" leads to "Athena checks: nulls, duplicates, ranges".
- "Athena checks: nulls, duplicates, ranges" leads to "All pass?".
- At "All pass?": if "Yes", go to "Load"; if "No", go to "Fix or reject".