nerdexam
Databricks

CERTIFIED-DATA-ENGINEER-PROFESSIONAL · Question #106

A data team's Structured Streaming job is configured to calculate running aggregates for item sales to update a downstream marketing dashboard. The marketing team has introduced a new field to track t

The correct answer is B. Specify a new checkpointlocation. When introducing a new aggregation or a change in the logic of a Structured Streaming query, it is generally necessary to specify a new checkpoint location. This is because the checkpoint directory contains metadata about the offsets and the state of the aggregations of a streami

Building and Managing Streaming Pipelines

Question

A data team's Structured Streaming job is configured to calculate running aggregates for item sales to update a downstream marketing dashboard. The marketing team has introduced a new field to track the number of times this promotion code is used for each item. A junior data engineer suggests updating the existing query as follows: Note that proposed changes are in bold. Original query:

Proposed query:

Proposed query:

.start(“/item_agg”) Which step must also be completed to put the proposed query into production?

Exhibits

CERTIFIED-DATA-ENGINEER-PROFESSIONAL question #106 exhibit 1
CERTIFIED-DATA-ENGINEER-PROFESSIONAL question #106 exhibit 2

Options

  • AIncrease the shuffle partitions to account for additional aggregates
  • BSpecify a new checkpointlocation
  • CRun REFRESH TABLE delta, /item_agg'
  • DRemove .option (mergeSchema', true') from the streaming write
  • ERegister the data in the "/item_agg" directory to the Hive metastore

How the community answered

(36 responses)
  • A
    3% (1)
  • B
    75% (27)
  • C
    3% (1)
  • D
    8% (3)
  • E
    11% (4)

Explanation

When introducing a new aggregation or a change in the logic of a Structured Streaming query, it is generally necessary to specify a new checkpoint location. This is because the checkpoint directory contains metadata about the offsets and the state of the aggregations of a streaming query. If the logic of the query changes, such as including a new aggregation field, the state information saved in the current checkpoint would not be compatible with the new logic, potentially leading to incorrect results or failures. Therefore, to accommodate the new field and ensure the streaming job has the correct starting point and state information for aggregations, a new checkpoint location should be specified.

Topics

#Structured Streaming#Checkpointing#Schema Evolution#Streaming Operations

Community Discussion

No community discussion yet for this question.

Full CERTIFIED-DATA-ENGINEER-PROFESSIONAL Practice