professional-cloud-data-engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
A data engineer is designing an automated post-ingestion cleansing pipeline in BigQuery for a multi-terabyte event ingestion table named telemetry.raw_events.
Due to upstream at-least-once streaming semantics, duplicate event payloads are frequently ingested. The cleansing pipeline must meet the following operational requirements:
device_id and event_id.ingestion_timestamp.Which SQL pattern should the data engineer implement?
This pattern uses a window function (ROW_NUMBER()) coupled with a CREATE OR REPLACE TABLE ... AS SELECT (DDL/DML) statement and the EXCEPT column modifier to perform an atomic, in-place deduplication of a BigQuery table.
device_id, event_id isolates duplicate groups into distinct evaluation windows.ingestion_timestamp DESC guarantees that the newest record is assigned row_num = 1.SELECT * EXCEPT(row_num) ensures that the transient ranking column is excluded from the final schema definition.CREATE OR REPLACE TABLE performs an atomic metadata swap that replaces the target table with the deduplicated dataset.ALTER TABLE DROP COLUMN operations by discarding helper attributes on write.Compared to row-by-row DELETE DML statements or expensive self-joins, evaluating window functions in a single-pass CREATE OR REPLACE TABLE AS SELECT query scans the data efficiently, minimizes slot execution time, and avoids concurrency limits associated with multiple mutation operations.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.