
Answer-first summary for fast verification
Answer: Hopping
## Window Function Analysis for Azure Stream Analytics ### Requirements Analysis: - **Window Size**: 5 minutes (last five minutes of data) - **Output Frequency**: Every minute - **Function**: Count of records ### Window Function Comparison: #### **Hopping Window (Correct Choice)** - **Definition**: A hopping window model that moves forward in time by a fixed period (hop size) and has a fixed duration (window size). - **Why it fits**: - Window size = 5 minutes (captures last 5 minutes of data) - Hop size = 1 minute (outputs every minute) - Syntax: `HOPPINGWINDOW(minute, 5, 1)` - Each window overlaps with previous windows, creating the "last 5 minutes every minute" behavior - Windows are aligned to clock time boundaries #### **Tumbling Window (Incorrect)** - **Definition**: Non-overlapping, contiguous time windows - **Why it doesn't fit**: - Windows don't overlap - Would output counts every 5 minutes, not every minute - Cannot achieve "last 5 minutes every minute" requirement #### **Sliding Window (Incorrect)** - **Definition**: Outputs events when events occur, with windows that slide continuously - **Why it doesn't fit**: - Only outputs when events are present in the window - May not produce output every minute if no new events arrive - Not aligned to fixed time intervals - Less predictable output frequency #### **Session Window (Incorrect)** - **Definition**: Groups events that occur close together in time, separated by gaps of inactivity - **Why it doesn't fit**: - Window boundaries are event-driven, not time-based - Cannot guarantee output every minute - Window sizes vary based on data patterns ### Key Technical Justification: The hopping window is specifically designed for scenarios requiring **regular, periodic outputs of overlapping time windows**. The combination of a 5-minute window size with a 1-minute hop size perfectly matches the requirement to "count records from the last five minutes every minute." Each output represents a complete 5-minute window that advances by 1 minute for each subsequent output, creating the overlapping coverage needed.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are using Azure Stream Analytics to ingest data from Azure Event Hubs and output data to an Azure Blob Storage account.
You must output the count of records received from the last five minutes, and this count should be calculated and emitted every minute.
Which windowing function should you use?
A
Session
B
Tumbling
C
Sliding
D
Hopping
No comments yet.