Streaming Analytics Windowing Functions Flashcards

1
Q

There are five kinds of temporal windows to choose from…

A

Tumbling,Hopping,Sliding,Session, andSnapshotwindows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

You use the window functions in the…….. of the query syntax in your Stream Analytics jobs.

A

GROUP_BY clause

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You can also aggregate events over multiple windows using the….

A

Windows() function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

All thewindowingoperations output results at the….of the window

A

End

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Note that when you start a stream analytics job, you can specify the…..and the system will automatically fetch previous events in the incoming streams to output the first window at the specified time; for example when you start with theNowoption, it will start to emit data immediately. The output of the window will be a ….. The output event will have the time stamp of the …. of the window and all window functions are defined with ……

(hint: when you start? how do you start?)
(hint: what do streaming windows capture?)
(hint: start or end)
(hint: all window functions last for a specific amount of time or …)

A

Job output start time

single event based on the aggregate function used.

end

a fixed length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

SELECT System.Timestamp() as WindowEndTime, TimeZone, COUNT(*) AS Count
FROM TwitterStream TIMESTAMP BY CreatedAt
GROUP BY TimeZone, TumblingWindow(second,10)

Will return?

A

WindowEndTime TimeZone Count

Example:
2021-10-26T10:15:10 - PST - 5
2021-10-26T10:15:20 - PST - 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Tumbling window

Tumblingwindow functions are used to segment a data stream into …. and perform a function against them.

The key differentiators of a Tumbling window are that they repeat, do not overlap, and an event cannot belong to more than one tumbling window.

A

distinct time segments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Tumbling window

Tumblingwindow functions are used to segment a data stream into distinct time segments and perform a function against them.

The key differentiators of a Tumbling window are that they …

A

repeat, do not overlap, and an event cannot belong to more than one tumbling window.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Hopping window

Hoppingwindow functions hop … by …. It may be easy to think of them as Tumbling windows that can overlap and be emitted more often than the window size. Events can belong to more than one Hopping window result set. To make a Hopping window the same as a Tumbling window, specify the hop size to be the same as the window size.

A

hop forward in time

a fixed period

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Hopping window

Hoppingwindow functions hop … by …. It may be easy to think of them …. Events can belong to more than one Hopping window result set. To make a Hopping window the same as a Tumbling window, …

A

hop forward in time

a fixed period

as Tumbling windows that can overlap and be emitted more often than the window size

specify the hop size to be the same as the window size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Hopping window

Hoppingwindow functions hop forward in time by a fixed period. It may be easy to think of them as Tumbling windows that can overlap and be emitted more often than the window size. Events can belong to more than one Hopping window result set. To make a Hopping window the same as a Tumbling window, …

A

specify the hop size to be the same as the window size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

SELECT System.Timestamp() as WindowEndTime, Topic, COUNT(*) AS Count
FROM TwitterStream TIMESTAMP BY CreatedAt
GROUP BY Topic, HoppingWindow(second,10,5)

A

WindowEndTime - Topic - Count

2021-10-26T10:15:10 - Streaming - 5
2021-10-26T10:15:15 - Streaming - 3
2021-10-26T10:15:20 - Streaming - 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Sliding window

Slidingwindows, unlike Tumbling or Hopping windows, output events only for points in time when the …. In other words, when an event enters or exits the window. So, every window has at least one event. Similar to Hopping windows, events can belong to more than one sliding window.

A

content of the window actually changes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Sliding window

Slidingwindows, unlike Tumbling or Hopping windows, output events only for points in time when the content of the window actually changes. In other words, when an event …. So, every window has at least one event. Similar to Hopping windows, events can belong to more than one sliding window.

A

enters or exits the window

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Sliding window

Slidingwindows, unlike Tumbling or Hopping windows, output events only for points in time when the content of the window actually changes. In other words, when an event enters or exits the window. So, every window has …. Similar to Hopping windows, events can belong to more than one sliding window.

A

at least one event

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

SELECT System.Timestamp() as WindowEndTime, Topic, COUNT() AS Count
FROM TwitterStream TIMESTAMP BY CreatedAt
GROUP BY Topic, SlidingWindow(second,10)
HAVING COUNT(
) >=3

Will output?

A
17
Q

Session window

Sessionwindow functions group events that arrive at…, filtering out periods of time where …. It has three main parameters: timeout, maximum duration, and partitioning key (optional).

A

similar times

there is no data.

18
Q

Session window

Sessionwindow functions group events that arrive at…, filtering out periods of time where …. It has three main parameters: timeout, maximum duration, and partitioning key (optional).

A session window begins when the ….. If another event occurs within the specified timeout from the last ingested event, then …. Otherwise if no events occur within the timeout, then the window is closed at the timeout.

A

similar times

there is no data.

first event occurs

the window extends to include the new event.

19
Q

Session window

A session window begins when the ….. If another event occurs within the specified timeout from the last ingested event, then …. Otherwise if no events occur within the timeout, then the window is closed at the timeout.

If events keep occurring within the specified timeout, the session window will keep extending until …. The maximum duration checking intervals are set to be the same size as the specified max duration. For example, if the max duration is 10, then the checks on if the window exceed maximum duration will happen at t = 0, 10, 20, 30, etc.

A

first event occurs

the window extends to include the new event.

until maximum duration is reached.

20
Q

Session window

Sessionwindow functions group events that arrive at similar times, filtering out periods of time where there is no data. It has three main parameters: timeout, maximum duration, and partitioning key (optional).

A session window begins when the ….. If another event occurs within the specified timeout from the last ingested event, then …. Otherwise if no events occur within the timeout, then the window is closed at the timeout.

A

first event occurs

the window extends to include the new event.

21
Q

Session window

Sessionwindow functions group events that arrive at similar times, filtering out periods of time where there is no data. It has three main parameters: timeout, maximum duration, and partitioning key (optional).
.
.
.
When a partition key is provided, the events are …. is applied to each group independently. This partitioning is useful for cases where you need different session windows for different users or devices.

A

grouped together by the key and session window

22
Q

SELECT System.Timestamp() as WindowEndTime, Topic, COUNT(*) AS Count
FROM TwitterStream TIMESTAMP BY CreatedAt
GROUP BY Topic, SessionWindow(second,5,10)

Will return …

A

WindowEndTime Topic Count

2021-10-26T10:15:09 - Streaming - 2
2021-10-26T10:15:24 - Streaming - 4

23
Q

Snapshot window

Snapshotwindows group events that have the… . Unlike other windowing types, which require a specific window function (such asSessionWindow() for example), you can apply a snapshot window by adding System.Timestamp() to the GROUP BY clause.

A

the same timestamp

24
Q

Snapshot window

Snapshotwindows group events that have the the same timestamp. Unlike other windowing types, which require a specific window function (such as…, you can apply a snapshot window by adding System.Timestamp() to the GROUP BY clause.

A

SessionWindow()) for example

25
Q

Snapshot window

Snapshotwindows group events that have the the same timestamp. Unlike other windowing types, which require a specific window function (such asSessionWindow() for example), you can apply a snapshot window by …..

A

adding System.Timestamp() to the GROUP BY clause

26
Q

SELECT System.Timestamp() as WindowEndTime, Topic, COUNT(*) AS Count
FROM TwitterStream TIMESTAMP BY CreatedAt
GROUP BY Topic, System.Timestamp()

Will return…

A

WindowEndTime Topic Count

2021-10-26T10:15:04 - Streaming - 4
2021-10-26T10:15:10 - Streaming - 2

27
Q

Tumbling window

Tumblingwindow functions are used to segment a data stream into distinct time segments and perform a function against them.

The key differentiators of a Tumbling window are that they …, …., and ….

A

repeat, do not overlap and an event cannot belong to more than one tumbling window.

28
Q

What is the difference between hopping window function and tumbling window function?

A

The hopping window is similar to the tumbling window, except that it is not contiguous. It aggregate events with a fixed time sized window, but you can choose to update that information in another time frame. Another example: “Every 20 minutes, give me the number of pizza orders I got in the last 10 minutes”.

29
Q

What is the difference between tumble window and sliding window?

A

What is the difference between tumble window and sliding window?
The main difference between these windows is that, Tumbling windows are non-overlapping whereas Sliding windows can be overlapping.

30
Q

What is Session window?

A

A session window begins when the first event occurs. If another event occurs within the specified timeout from the last ingested event, then the window extends to include the new event. Otherwise if no events occur within the timeout, then the window is closed at the timeout.

31
Q

What is a Snapshot window?

A

Snapshot windows groups events that have the same timestamp. Unlike other windowing types, which require a specific window function (such as SessionWindow(), you can apply a snapshot window by adding System.

32
Q

Tumbling ….
Hopping is simlar to …..
Sliding…

A

Tumbling repeats at a non-overlapping interval. Como escalera en cada intervalo de tiempo, no se pisan

Hopping is simlar to tumbling, but hopping generally has an overlapping interveral. Cada cierto X tiempo va tomando fotos haya o no eventos, puede hacer overlap de eventos. Tiene un Hop o salto para ir revisando X segundos hacia atras.
Example:
A 10 second Hopping Window with a 5 second “hop”
Every 5 seconds give me the count of tweets over the last 10 seconds

Sliding triggers at regular time intervals. Cada X segundos va revisando si hay un nuevo evento, si es asi abre una ventana nueva q puede abarcar los eventos anteriores