QuestionQ209

VerifiedDebugging and Deploying

A data team’s Structured Streaming job is set up to calculate running aggregates for item sales and update a downstream marketing dashboard. The marketing team has launched a new promotion and wants to add a field that tracks how many times the promotion code is used for each item. A junior data engineer proposes updating the existing query as follows. Note that the proposed changes are in bold.

Original query:

Question Image

Proposed query:

Question Image

Proposed query:

.start(“/item_agg”)

Which additional step must be completed to deploy the proposed query to production?

Explanation

A streaming aggregation maintains checkpointed state. Adding an aggregate changes that state schema, and Spark does not allow a streaming aggregation with a changed number or type of aggregates to restart from the existing checkpoint. The revised query must use a new checkpoint location.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!