PDE Preparing and Using Data for Analysis Practice Question
You are using Cloud Dataflow to stream data from Pub/Sub into BigQuery. The incoming messages are JSON strings with a field `event_time` in ISO 8601 format (e.g., "2024-03-15T14:30:00Z"). You need to write the data to a BigQuery table with a column `event_timestamp` of type TIMESTAMP. Which transformation should you apply in your Dataflow pipeline?
⚠ Common exam trap
The trap here is assuming that BigQuery can automatically convert string timestamps during streaming inserts, which it cannot without explicit transformation.
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
✓
Use a ParDo to parse the JSON and convert `event_time` to a BigQuery TIMESTAMP using the appropriate library for your pipeline language (e.g., Instant.parse in Java or datetime.fromisoformat in Python).
The correct approach is to parse the JSON and convert the ISO 8601 string to a native timestamp type within the Dataflow pipeline. This ensures that the data written to BigQuery matches the TIMESTAMP column type. BigQueryIO expects the input PCollection to contain TableRow objects with fields matching the destination schema, so converting the string to a timestamp before writing is necessary.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a SQL query in BigQuery to convert the string to TIMESTAMP after the data is loaded into a staging table.
Why it's wrong here
While you could stage the data as STRING and then run a SQL query to convert it, this adds an extra step and does not address the pipeline requirement. The question asks for a transformation in the Dataflow pipeline, so handling it post-load is not the intended solution. It also increases latency and complexity.
- ✓
Use a ParDo to parse the JSON and convert `event_time` to a BigQuery TIMESTAMP using the appropriate library for your pipeline language (e.g., Instant.parse in Java or datetime.fromisoformat in Python).
Why this is correct
Parsing the JSON and converting the ISO 8601 string to a native timestamp type ensures that BigQuery receives a proper TIMESTAMP value. Dataflow's BigQueryIO can then write it correctly. This approach handles time zones and formatting consistently, and is the standard way to transform string timestamps in a pipeline.
- ✗
Configure BigQueryIO to write the `event_time` field as a STRING and rely on BigQuery's automatic schema detection to convert it to TIMESTAMP.
Why it's wrong here
BigQuery does not automatically convert STRING to TIMESTAMP during load or streaming insert unless the string is in a specific format and you use a load job with schema autodetect, which is not available for streaming inserts. Writing as STRING would result in a type mismatch error if the destination column is TIMESTAMP. This option is incorrect.
- ✗
In the Dataflow pipeline, use a WithTimestamps transform to assign the event time as the element timestamp, and then write the original string to BigQuery.
Why it's wrong here
WithTimestamps is used for assigning event-time timestamps for windowing purposes in Dataflow, not for converting data types for BigQuery output. Writing the original string would still cause a type mismatch. This transform does not change the data itself, so it does not solve the problem.
Go deeper
Related to this question
About these practice questions
This PDE question is part of Courseiva's 747-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
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.