DP-200 Exam QuestionsBrowse all questions from this exam

DP-200 Exam - Question 43


HOTSPOT -

You have the following Azure Stream Analytics query.

Exam DP-200 Question 43

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

NOTE: Each correct selection is worth one point.

Hot Area:

Exam DP-200 Question 43
Show Answer
Correct Answer:
Exam DP-200 Question 43

Box 1: No -

Note: You can now use a new extension of Azure Stream Analytics SQL to specify the number of partitions of a stream when reshuffling the data.

The outcome is a stream that has the same partition scheme. Please see below for an example:

WITH step1 AS (SELECT * FROM [input1] PARTITION BY DeviceID INTO 10), step2 AS (SELECT * FROM [input2] PARTITION BY DeviceID INTO 10)

SELECT * INTO [output] FROM step1 PARTITION BY DeviceID UNION step2 PARTITION BY DeviceID

Note: The new extension of Azure Stream Analytics SQL includes a keyword INTO that allows you to specify the number of partitions for a stream when performing reshuffling using a PARTITION BY statement.

Box 2: Yes -

When joining two streams of data explicitly repartitioned, these streams must have the same partition key and partition count.

Box 3: Yes -

Streaming Units (SUs) represents the computing resources that are allocated to execute a Stream Analytics job. The higher the number of SUs, the more CPU and memory resources are allocated for your job.

In general, the best practice is to start with 6 SUs for queries that don't use PARTITION BY.

Here there are 10 partitions, so 6x10 = 60 SUs is good.

Note: Remember, Streaming Unit (SU) count, which is the unit of scale for Azure Stream Analytics, must be adjusted so the number of physical resources available to the job can fit the partitioned flow. In general, six SUs is a good number to assign to each partition. In case there are insufficient resources assigned to the job, the system will only apply the repartition if it benefits the job.

Reference:

https://azure.microsoft.com/en-in/blog/maximize-throughput-with-repartitioning-in-azure-stream-analytics/ https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-streaming-unit-consumption

Discussion

15 comments
Sign in to comment
sjsheikdawood
May 1, 2021

Answer is No,No,No (source whizlab) Here we are using the UNION clause which is different from the JOIN clause We need to match the partition key in the input and output scheme, but not necessarily need to match the count. You can scale up to 6 streaming units for each step in a job. If you have partitions, you need to multiply the number of partitions by 6. Now in the query, we have 2 select queries in the input streams. And each has a partition count of 10. That means we can scale the job to the following number of streaming units. Number of SELECT queries * Number of partitions * 6 = 2*10*6 = 120 In the query, we have one SELECT statement in the output with no partition count. Hence the calculation for the maximum number of streaming units is Number of SELECT queries * 6 = 6. Hence the total number of streaming units that can be assigned to the job is 126.

vaseva1
Apr 5, 2021

Yes at 1st Question

Sherinm
Apr 6, 2021

Box 1 is Yes. When joining two streams of data explicitly repartitioned, these streams must have the same partition key and partition count. The outcome is a stream that has the same partition scheme. https://azure.microsoft.com/en-in/blog/maximize-throughput-with-repartitioning-in-azure-stream-analytics/

cadio30
Apr 28, 2021

The following example query joins two streams of repartitioned data. When joining two streams of repartitioned data, the streams must have the same partition key and count. The outcome is a stream that has the same partition scheme. WITH step1 AS (SELECT * FROM input1 PARTITION BY DeviceID), step2 AS (SELECT * FROM input2 PARTITION BY DeviceID) SELECT * INTO output FROM step1 PARTITION BY DeviceID UNION step2 PARTITION BY DeviceID Reference: https://docs.microsoft.com/en-us/azure/stream-analytics/repartition

cadio30
May 7, 2021

Propose solution is No, Yes, Yes Referencing the query, the "PARTITION" keyword is missing after the "union step2"

jasonoubre
Jun 1, 2021

so what is the answer??

vrmei
Jun 5, 2021

Second Option should be No. The output scheme should match the stream scheme key and count so that each substream can be flushed independently. https://docs.microsoft.com/en-us/azure/stream-analytics/repartition

hello_there_
Jun 23, 2021

The answer is yes, yes, no. The example comes almost directly from the microsoft documentation. Quoting from docs.microsoft.com/en-us/azure/stream-analytics/repartition: The following example query joins two streams of repartitioned data. When joining two streams of repartitioned data, the streams must have the same partition key and count. The outcome is a stream that has the same partition scheme. SQL WITH step1 AS (SELECT * FROM input1 PARTITION BY DeviceID), step2 AS (SELECT * FROM input2 PARTITION BY DeviceID) SELECT * INTO output FROM step1 PARTITION BY DeviceID UNION step2 PARTITION BY DeviceID The documentation clearly states that this example consitutes a join of partitioned streams, even though traditionally one might not consider a union a join. Others have explained why 60 stu is not optimal.

hello_there_
Jun 23, 2021

I forgot to include the following from the same documetation: The output scheme should match the stream scheme key and count so that each substream can be flushed independently. I guess the question states "must" while the documentation states "should", so I guess "no" is the technically correct answer here.

AngelRio
Apr 20, 2021

No, No and No (source Whizlabs)

kriskan1
Apr 23, 2021

In the union query for step2 there is no partition by. so may be the query is wront. thats the reason for No for 1st question

dangal95
Apr 24, 2021

why are some people saying that the first one is also yes? A Union is not a join. A union will combine the rows from both steps together. A join would combine the columns based on some join condition

Rob77
May 19, 2021

and yet Microsoft calls union "join" see https://docs.microsoft.com/en-us/azure/stream-analytics/repartition

Aragorn_2021
Apr 29, 2021

Answer for RU unit is wrong. Ideal RU unit required is 126

NamishBansal
May 1, 2021

3rd question is correct. While 126 RUs might be the most ideal, 60 RUs will still optimize the preformance.

niwe
Jun 2, 2021

I don't think "Union step2 By StateID" it is valid.

massnonn
Nov 20, 2021

the answer is yes-yes-yes

Sai2609
Apr 23, 2021

It should be yes,yes,yes