exam questions

Exam DP-203 All Questions

View all questions & answers for the DP-203 exam

Exam DP-203 topic 2 question 48 discussion

Actual exam question from Microsoft's DP-203
Question #: 48
Topic #: 2
[All DP-203 Questions]

HOTSPOT -
You are building an Azure Stream Analytics job to retrieve game data.
You need to ensure that the job returns the highest scoring record for each five-minute time interval of each game.
How should you complete the Stream Analytics query? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: TopOne OVER(PARTITION BY Game ORDER BY Score Desc)
TopOne returns the top-rank record, where rank defines the ranking position of the event in the window according to the specified ordering. Ordering/ranking is based on event columns and can be specified in ORDER BY clause.
Box 2: Hopping(minute,5)
Hopping window 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, specify the hop size to be the same as the window size.

Reference:
https://docs.microsoft.com/en-us/stream-analytics-query/topone-azure-stream-analytics https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-window-functions

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
alexleonvalencia
Highly Voted 3 years, 1 month ago
TopOne() / Tumbling
upvoted 141 times
MarcelT
1 year, 11 months ago
The Select built with the TopOne() option would return one row for each game. Still, it would not tell you the game (SELECT TOP_ONE()... FROM). On the other hand, the GAME,MAX() option clearly informs the Game.
upvoted 11 times
Gikan
11 months, 2 weeks ago
In case of "game, max()" the "group by" cause should contain the "game", otherwise it returns an error
upvoted 3 times
Gikan
11 months, 2 weeks ago
but in this case no definition for 5 minutes, so it is a bad idea
upvoted 2 times
...
...
_lene_
1 year, 9 months ago
The question was "the highest scoring record of each game", so that's what we need - one row for each game
upvoted 3 times
...
cr727
1 year, 11 months ago
I think its TopOne() as "TopOne() OVER(partition by Game order by Score Desc)", it orders by descending of Score and by partition, and top one of each of them.
upvoted 3 times
...
...
...
gf2tw
Highly Voted 3 years, 1 month ago
Syntax for Hopping window requires 3 arguments, seems this should be Tumbling Window which fulfils the exact same requirements.
upvoted 45 times
anto69
2 years, 11 months ago
Yeah sure
upvoted 2 times
...
...
Dusica
Most Recent 8 months, 3 weeks ago
topone().. is correct but it is a tumbling window; hopping window has two number, window length and hop length
upvoted 2 times
...
Alongi
9 months ago
TopOne Tumbling
upvoted 2 times
...
Alongi
9 months, 2 weeks ago
Top One and Tumbling
upvoted 1 times
...
Joanna0
11 months, 1 week ago
https://learn.microsoft.com/en-us/stream-analytics-query/topone-azure-stream-analytics Topone() Tumbling
upvoted 2 times
j888
11 months ago
I believe Max score is simpler. Not making any sense to re-arrange it and then pick the top.
upvoted 2 times
...
...
wel_fardeheb
11 months, 1 week ago
got this question on my exam
upvoted 2 times
...
6d954df
1 year ago
SELECT TopOne() OVER(PARTITION BY Game ORDER BY Score Desc) as HighestScore FROM input TIMESTAMP BY CreatedAt GROUP BY Game, TumblingWindow(minute,5) Here’s what this query does: TopOne() OVER(PARTITION BY Game ORDER BY Score Desc) selects the highest scoring record in each partition of games. TIMESTAMP BY CreatedAt specifies the timestamp of each event. GROUP BY Game, TumblingWindow(minute,5) groups the output by game and in five-minute intervals. The TumblingWindow function creates a series of fixed-sized, non-overlapping and contiguous time intervals. Please note that this is a general guidance and the actual query might need to be adjusted based on the specific requirements and data schema of your game data.
upvoted 3 times
...
Momoanwar
1 year, 1 month ago
Wrong, chatgpt : For the Azure Stream Analytics job that needs to return the highest scoring record for each five-minute interval of each game, the query should use the following options: 1. **SELECT**: `TopOne() OVER(PARTITION BY Game ORDER BY Score Desc)` as HighestScore - This function returns the highest score for each partitioned group (each game in this case), ordered by score in descending order, ensuring that the highest score is selected. 2. **GROUP BY**: `TumblingWindow(minute, 5)` - This window function groups the events into non-overlapping, continuous five-minute intervals, which is what's required to get the highest score in each five-minute time slice. This configuration will ensure that you get the highest score for each game every five minutes.
upvoted 2 times
...
MarkJoh
1 year, 1 month ago
There really isn't a solution based on the options given. First off, Hopping() and Tumbling() don't exist, it's HoppingWindow and TumblingWindow So, the group by only has Game Windows(TublingWindow(minute, 5, Hopping(minute, 5)) But, that last one isn't valid either in multiple ways. So, only Group by Game is valid. So, you can try it this way... SELECT TOPOne() OVER (PARTITION BY Game ORDER BY Score DESC) FROM input TIMESTAMP BY CreatedDt GROUP BY game But, that does nothing with 5 minute window. So, there is NO solution based on the data given. I would write it this way SELECT game, MAX(Score) as MaxScore FROM intput TIMESTAMP by CreatedAt Group by Game, TumblingWindow(minute, 5) But, those aren't options provided.
upvoted 4 times
Mausar
10 months, 2 weeks ago
it is accepted both syntax: {TUMBLINGWINDOW | TUMBLING} ( timeunit , windowsize, [offsetsize] ) {HOPPINGWINDOW | HOPPING} ( timeunit , windowsize , hopsize, [offsetsize] ) https://learn.microsoft.com/en-us/stream-analytics-query/tumbling-window-azure-stream-analytics
upvoted 2 times
...
...
kkk5566
1 year, 4 months ago
Game(max) and tumbling window is the correct answer
upvoted 6 times
...
pavankr
1 year, 6 months ago
"Hopping(minute,5)" - the syntax itself is wrong. Not sure who is preparing these answers???
upvoted 7 times
...
akk_1289
2 years ago
minute time interval of each game, you can use the TumblingWindow function to define a five-minute tumbling window over the data, and then use the MAX function to select the highest scoring record within each window.
upvoted 9 times
mroova
1 year, 11 months ago
Totally agree: - Game, max() - you need to have [Game] column to know, which game the max score refers to, - tumbling window - requires 2 arguments, hopping window could be used, but requires 3 arguments
upvoted 10 times
auwia
1 year, 6 months ago
Then you have to put "game" attribute in the group by as well, but there is only 1 option and it's without the window! So ripone / tumbling!
upvoted 4 times
auwia
1 year, 6 months ago
Topone
upvoted 3 times
...
...
...
...
Achu24
2 years ago
Game(max) and tumbling window is the correct answer
upvoted 7 times
mesloth
2 years ago
Correct. Here top score is being asked, instead of Rank
upvoted 3 times
...
...
JosephVishal
2 years, 1 month ago
Tumbling window seems to be correct, in question there is no fixed time interval specified.
upvoted 1 times
...
THAYTRUONG
2 years, 1 month ago
TopOne() / Tumbling is correct answer
upvoted 2 times
...
bakstorage00001
2 years, 3 months ago
This is clearly a fu**-up, it's a tumbling Window. For sure! I wonder what would happen in the exam if you select Tumbling...
upvoted 3 times
allagowf
2 years, 3 months ago
true, if tumbling is not the correct answer in the exam then we fu**-up really fu**-up hahaha
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...