QuestionQ281

VerifiedCost & Performance Optimisation

A data engineer needs to join a stream of advertisement impressions (when an ad was displayed) with another stream of users’ advertisement clicks to correlate which impressions resulted in monetizable clicks.

In the following code, Impressions is a streaming DataFrame with a watermark of ("event_time", "10 minutes").

Question Image

The data engineer observes that the query is slowing down substantially.

Which solution would improve performance?

Explanation

A bounded event-time join condition prevents unbounded state growth in a stream–stream join. Restricting clicks to those occurring at or after the impression and within one hour of it lets the streaming engine evict old rows that can no longer match, while preserving the intended impression-to-click correlation.

Learn more

Community Discussion

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