mediumMultiple Choice
PDE Practice Question: A Dataflow pipeline reads log files from Cloud…
Exhibit
Refer to the exhibit. ``` # Dataflow pipeline log snippet 2024-03-15 10:00:00 ERROR Transform 'ParseLogs': org.apache.beam.sdk.util.WindowedValue$CoderLoadingException: Unable to load coder for class com.example.LogEvent 2024-03-15 10:00:01 ERROR Transform 'ParseLogs': java.lang.NoSuchMethodError: com.example.LogEvent: method <init>()V not found ```
A Dataflow pipeline reads log files from Cloud Storage, parses them into LogEvent objects, and writes to BigQuery. The pipeline fails with the above errors. What is the most likely cause?
⚠ Common exam trap
Many exam-takers confuse runtime serialization errors with compile-time import issues or schema mismatches, overlooking the fundamental requirement for a no-argument constructor in Beam's default coders.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The LogEvent class does not have a no-argument constructor.
Apache Beam's SDK requires that custom types used as PCollection elements (like LogEvent) have a no-argument constructor so that the framework can deserialize objects during distributed processing, especially when using the Dataflow runner. Without it, the pipeline fails at runtime with a serialization error because Beam's default coder (e.g., SerializableCoder) cannot reconstruct the object.
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 LogEvent class does not have a no-argument constructor.
Why this is correct
Apache Beam serialises user-defined types between workers, and its default coder for a custom class requires a public no-argument constructor to instantiate the object during deserialisation. Without one, the pipeline cannot reconstruct LogEvent instances, producing the construction failure observed.
- ✗
The pipeline is missing required import statements for LogEvent.
Why it's wrong here
Missing imports would cause a compile-time pipeline construction failure, not the runtime errors described. Imports are genuinely required when referencing custom classes such as LogEvent in DoFn signatures, so this is the right fix for a different symptom: an unbuildable pipeline that never launches.
- ✗
The BigQuery table schema does not match the LogEvent fields.
Why it's wrong here
A schema mismatch surfaces only at BigQuery write time as insertion errors, not during parsing of the log files. Schema alignment is genuinely required when LogEvent fields and the destination table columns diverge, so this is the correct diagnosis for a pipeline that parses successfully but fails on load.
- ✗
The log files are not in the expected format, causing parsing failures.
Why it's wrong here
Parsing failures produce per-element exceptions such as NumberFormatException or IllegalArgumentException on specific records, not the pipeline-level errors shown. It is tempting because malformed input commonly breaks Dataflow jobs, and would be correct if the stack trace pointed at the parse step rather than pipeline construction.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PDE question from scratch — 747 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PDE practice question is part of Courseiva's free Google Cloud 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 PDE exam.