Exams / AIP-C01 / Study guide / Validating data quality before it reaches a model (Glue Data Quality, Lambda checks)
Validating data quality before it reaches a model (Glue Data Quality, Lambda checks): AIP-C01 study notes and practice questions
What to know about Validating data quality before it reaches a model (Glue Data Quality, Lambda checks) for the AIP-C01 exam, from the Foundation Model Integration, Data Management, and Compliance domain (31% of the exam guide), then 2 free questions to test it. Part of the AIP-C01 study guide.
Typical scenarios: a RAG corpus fills with empty or duplicate files, a fine-tuning job fails on malformed lines, or a feed silently stops updating. Pick the check, the place it runs and what happens to the records that fail.
Where the checks run
AWS Glue Data Quality evaluates rules written in DQDL against tables in the Glue Data Catalog. Rule types include row count, completeness, uniqueness, referential integrity and custom SQL. Each rule returns a pass or fail result. See Glue Data Quality.
Lambda validation covers what table rules cannot: file type, JSON structure of each line, file size, page count. It publishes pass and fail counts as CloudWatch metrics.
Documents and images are not tables. Extract their metadata (name, size, content hash, modified date) into a table or manifest first, then run rules on that.
Each line parses, the keys the model’s format requires exist (prompt and completion, or messages), size limits, no empty completions
Records that feed prompts
Schema, data types, allowed values, normalized dates and units
Quarantine, do not drop silently
Route failing files or records to a quarantine prefix in S3 or a quarantine table, and store the name of the rule that failed.
Alarm on the failure rate in CloudWatch and notify the owner through SNS or EventBridge.
Let good records flow. One bad file should not block the whole corpus, unless the failure rate crosses a threshold that signals a broken source.
Duplicates and freshness
Duplicate and empty documents waste embedding cost and produce repeated or thin answers. Detect exact duplicates with a content hash before embedding. A freshness check flags a source that has not changed in an expected window, which usually means a connector or export job has failed.
How to choose
Scenario wording
Choose
“Malformed lines break the fine-tuning job”
Lambda JSONL validation before submit, with quarantine
“Every record must have a customer ID”
Glue Data Quality completeness rule
“Stop empty or duplicate documents entering the vector store”
Pre-embedding checks on length and content hash
“Detect that the feed stopped updating”
Freshness check with a CloudWatch alarm
“Keep the pipeline running but flag bad records”
Quarantine plus a metric and an alert
Common traps
Validating after embedding, which wastes cost and leaves bad vectors in the store.
Dropping bad records silently, which leaves no audit trail.
Running Glue Data Quality on raw PDFs, which are not tables.
Checking schema only and missing empty text or duplicate content.
Blocking the whole corpus for one bad file instead of quarantining it.
A logistics company keeps shipment records in Parquet files in an Amazon S3 data lake. A nightly AWS Glue job converts the records into JSON documents, which are then ingested into a knowledge base that dispatchers query.
In recent weeks, records with missing tracking numbers, empty origin fields and duplicate shipment IDs reached the knowledge base, and dispatchers received wrong answers.
The data engineering team wants bad records caught before ingestion, with the rules written as declarative checks instead of custom code, and the clean records should still flow on schedule.
Which change meets these requirements?
Choose one answer.
AA. Add a Lambda function that runs after each knowledge base sync, finds documents with empty fields, and deletes them from the index, so that dispatchers stop seeing them.
BB. Ask dispatchers to report wrong answers every week, and have an engineer correct the affected shipment records by hand in the S3 bucket before the next nightly run.
CC. Turn on Amazon Macie for the S3 bucket, so that it flags records with missing tracking numbers and duplicate shipment IDs before the nightly Glue job runs.
DD. Define Glue Data Quality rulesets for completeness and uniqueness in the nightly Glue job, and route failing records to a quarantine prefix before ingestion runs.
Show the answer and explanation
Answer: D
A. Wrong: The bad documents would already be indexed and visible to dispatchers before the function removed them. Checking after ingestion also means the team has to write custom deletion code, which the requirements avoid.
B. Wrong: Manual review finds problems only after dispatchers have already received wrong answers. It does not provide the automated pre-ingestion checks the team asked for.
C. Wrong: Macie discovers sensitive data such as personal information in S3, not missing fields or duplicate keys. It would not enforce the quality rules, so this option does not meet the requirement.
D. Right: Glue Data Quality rules are declarative and run inside the existing Glue job, so no custom checking code is needed. Failing records are quarantined before ingestion, while clean records continue on the normal schedule. Learn more: AWS Glue Data Quality (opens in a new tab)
Explanation
Glue Data Quality checks records before they become documents, using declarative rules inside the existing nightly job. Quarantining failed records keeps the bad data out of the knowledge base while clean records still flow. Checks after ingestion, manual review and Macie each miss at least one requirement.
A digital bank answers customers' questions about its fee schedules and loan terms with a retrieval assistant. Its knowledge base syncs from a SharePoint library every hour.
Last quarter, a sync ran with a partial file listing and reported success, so the assistant kept quoting a fee schedule that had been replaced two weeks earlier. Nobody noticed until a customer complained.
The risk team wants the bank to detect a stale or incomplete knowledge base within one hour of a bad sync, using checks that compare the source with what was ingested, and it wants the alert to reach an on-call engineer.
Which solution meets these requirements?
Choose one answer.
AA. Treat a sync job with a Complete status as proof that every file was ingested, and add an EventBridge rule that pages on-call when a sync job fails.
BB. Re-embed the entire SharePoint library every hour with direct ingestion, so that the knowledge base always holds a full copy, and skip any comparison step.
CC. After each sync, run a Lambda function that compares SharePoint file counts and modified dates with the ingested documents, and alarm through CloudWatch and SNS on any gap.
DD. Add a contextual grounding check with a guardrail to the assistant, so that any answer not supported by the retrieved passages is blocked before it reaches the customer.
Show the answer and explanation
Answer: C
A. Wrong: The failure in this case was a sync that reported success while missing files, so a Complete status is not proof of completeness. The rule would never fire for this type of error, so the requirement is missed.
B. Wrong: Re-ingesting everything every hour is costly, and it still does not confirm that the source and index match. Without a comparison, the team cannot detect a stale or incomplete state, so the requirement is missed.
C. Right: The comparison catches both missing files and out-of-date files within one sync cycle, and the CloudWatch alarm notifies on-call through SNS. This matches the check and alert requirements without changing how the content is synced. Learn more: Invoke a Lambda function from an alarm (opens in a new tab)
D. Wrong: A grounding check tests answers against the passages that were retrieved, and an old fee schedule is still grounded in the index. The guardrail would not detect the stale or missing content, so the requirement is missed. Learn more: Contextual grounding checks (opens in a new tab)
Explanation
Comparing source files with the ingested documents after each sync detects both missing and outdated content, and a CloudWatch alarm reaches on-call. A sync's success status does not prove completeness, a full re-embed is costly and still unchecked, and a grounding check cannot tell that a retrieved passage is outdated.
Want more on Validating data quality before it reaches a model (Glue Data Quality, Lambda checks)? The 5 full-length practice sets have 5 more Validating data quality before it reaches a model (Glue Data Quality, Lambda checks) questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →
Study Validating data quality before it reaches a model (Glue Data Quality, Lambda checks)