MLA-C01 Data Preparation for Machine Learning Practice Question
This MLA-C01 practice question tests your understanding of data preparation for machine learning. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Exhibit
import sys
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
args = getResolvedOptions(sys.argv, ['JOB_NAME'])
sc = SparkContext()
glueContext = GlueContext(sc)
spark = glueContext.spark_session
job = Job(glueContext)
job.init(args['JOB_NAME'], args)
raw = glueContext.create_dynamic_frame.from_options(
connection_type="s3",
connection_options={"paths": ["s3://bucket/input/year=2023/month=01/"]},
format="json")
transformed = raw.select_fields(["col1", "col2"]).rename_field("col1", "new_col")
glueContext.write_dynamic_frame.from_options(
frame=transformed,
connection_type="s3",
connection_options={"path": "s3://bucket/output/transformed"},
format="parquet")
job.commit()
Refer to the exhibit. A data engineer runs an AWS Glue ETL job with the following script portion. The job fails with an error: 'An error occurred while calling o113.pyWriteDynamicFrame. No such file or directory'. What is the most likely cause?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue: "most likely"
Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
Exhibit
import sys
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
args = getResolvedOptions(sys.argv, ['JOB_NAME'])
sc = SparkContext()
glueContext = GlueContext(sc)
spark = glueContext.spark_session
job = Job(glueContext)
job.init(args['JOB_NAME'], args)
raw = glueContext.create_dynamic_frame.from_options(
connection_type="s3",
connection_options={"paths": ["s3://bucket/input/year=2023/month=01/"]},
format="json")
transformed = raw.select_fields(["col1", "col2"]).rename_field("col1", "new_col")
glueContext.write_dynamic_frame.from_options(
frame=transformed,
connection_type="s3",
connection_options={"path": "s3://bucket/output/transformed"},
format="parquet")
job.commit()
A
The output format 'parquet' is not supported by Glue
Why wrong: Parquet is supported.
B
The input partition path is incorrect because it includes the partition key
Why wrong: Including partition key in path is acceptable.
C
The output S3 path is missing a trailing slash
Glue DynamicFrame write expects a directory path ending with '/'.
D
The schema contains a column with a reserved name
Why wrong: Error message does not indicate schema issue.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The output S3 path is missing a trailing slash
The error 'No such file or directory' when calling `pyWriteDynamicFrame` typically occurs because AWS Glue expects the output S3 path to end with a trailing slash to denote a directory. Without it, Glue may interpret the path as a file name rather than a directory, leading to a failure when attempting to write the Parquet files. Adding a trailing slash (e.g., `s3://bucket/output/`) resolves the issue.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
The output format 'parquet' is not supported by Glue
Why it's wrong here
Parquet is supported.
✗
The input partition path is incorrect because it includes the partition key
Why it's wrong here
Including partition key in path is acceptable.
✓
The output S3 path is missing a trailing slash
Why this is correct
Glue DynamicFrame write expects a directory path ending with '/'.
Clue confirmation
The clue word "most likely" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
✗
The schema contains a column with a reserved name
Why it's wrong here
Error message does not indicate schema issue.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often focus on data format or schema issues, overlooking the subtle file system requirement for a trailing slash in the output path, which is a common source of runtime errors in Spark-based ETL jobs.
Detailed technical explanation
How to think about this question
Under the hood, AWS Glue uses Apache Spark's DataFrame writer, which requires the output path to be a directory. When the path lacks a trailing slash, Spark may treat it as a file path, causing a `FileNotFoundException` when it tries to create subdirectories for partitions or metadata. This is a common pitfall when constructing S3 paths programmatically, especially when concatenating strings without ensuring a trailing delimiter.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A startup's cloud architect reviews their monthly bill and notices costs are higher than expected for a long-running batch job. Switching from on-demand instances to Reserved Instances — or using Spot/Preemptible VMs — can reduce compute costs by up to 72 %. Questions like this test whether you understand the tradeoffs between commitment, flexibility, and cost across cloud pricing models.
Visual reference
Quick reference
AWS S3 Storage Class Comparison
Storage Class
Min Duration
Retrieval
Use Case
S3 Standard
None
Immediate
Frequently accessed data
S3 Standard-IA
30 days
Immediate
Infrequent access, rapid retrieval
S3 One Zone-IA
30 days
Immediate
Non-critical infrequent data
S3 Intelligent-Tiering
None
Immediate–hours
Unknown or changing access patterns
S3 Glacier Instant
90 days
Milliseconds
Archive with instant retrieval
S3 Glacier Flexible
90 days
Minutes–hours
Archive, flexible retrieval
S3 Glacier Deep Archive
180 days
Hours
Long-term compliance archive
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Data Preparation for Machine Learning — This question tests Data Preparation for Machine Learning — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: The output S3 path is missing a trailing slash — The error 'No such file or directory' when calling `pyWriteDynamicFrame` typically occurs because AWS Glue expects the output S3 path to end with a trailing slash to denote a directory. Without it, Glue may interpret the path as a file name rather than a directory, leading to a failure when attempting to write the Parquet files. Adding a trailing slash (e.g., `s3://bucket/output/`) resolves the issue.
What should I do if I get this MLA-C01 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Are there clue words in this question I should notice?
Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
This MLA-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MLA-C01 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.