Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Exam Databricks Certified Associate Developer for Apache Spark 3.0 Topic 2 Question 40 Discussion

Actual exam question for Databricks's Databricks Certified Associate Developer for Apache Spark 3.0 exam
Question #: 40
Topic #: 2
[All Databricks Certified Associate Developer for Apache Spark 3.0 Questions]

Which of the following describes tasks?

Show Suggested Answer Hide Answer
Suggested Answer: E

Output of correct code block:

+----------------------------------+------+

|itemName |col |

+----------------------------------+------+

|Thick Coat for Walking in the Snow|blue |

|Thick Coat for Walking in the Snow|winter|

|Thick Coat for Walking in the Snow|cozy |

|Outdoors Backpack |green |

|Outdoors Backpack |summer|

|Outdoors Backpack |travel|

+----------------------------------+------+

The key to solving this Question: is knowing about Spark's explode operator. Using this operator, you can extract values from arrays into single rows. The following guidance steps through

the

answers systematically from the first to the last gap. Note that there are many ways to solving the gap questions and filtering out wrong answers, you do not always have to start filtering out from the

first gap, but can also exclude some answers based on obvious problems you see with them.

The answers to the first gap present you with two options: filter and where. These two are actually synonyms in PySpark, so using either of those is fine. The answer options to this gap therefore do

not help us in selecting the right answer.

The second gap is more interesting. One answer option includes 'Sports'.isin(col('Supplier')). This construct does not work, since Python's string does not have an isin method. Another option

contains col(supplier). Here, Python will try to interpret supplier as a variable. We have not set this variable, so this is not a viable answer. Then, you are left with answers options that include col

('supplier').contains('Sports') and col('supplier').isin('Sports'). The Question: states that we are looking for suppliers whose name includes Sports, so we have to go for the contains operator

here.

We would use the isin operator if we wanted to filter out for supplier names that match any entries in a list of supplier names.

Finally, we are left with two answers that fill the third gap both with 'itemName' and the fourth gap either with explode('attributes') or 'attributes'. While both are correct Spark syntax, only explode

('attributes') will help us achieve our goal. Specifically, the Question: asks for one attribute from column attributes per row - this is what the explode() operator does.

One answer option also includes array_explode() which is not a valid operator in PySpark.

More info: pyspark.sql.functions.explode --- PySpark 3.1.2 documentation

Static notebook | Dynamic notebook: See test 3, Question: 39 (Databricks import instructions)


Contribute your Thoughts:

Casie
2 months ago
I hope the exam doesn't have too many questions as head-scratching as this one. I might need to phone a friend for this one!
upvoted 0 times
Loreen
6 days ago
I hope the exam doesn't have too many questions as head-scratching as this one. I might need to phone a friend for this one!
upvoted 0 times
...
Hermila
7 days ago
E) Tasks get assigned to the executors by the driver.
upvoted 0 times
...
Marion
8 days ago
A) A task is a command sent from the driver to the executors in response to a transformation.
upvoted 0 times
...
...
Stevie
2 months ago
D has to be a joke, right? A task is definitely not a collection of rows. I'm confident the answer is E.
upvoted 0 times
...
Jonell
2 months ago
Option A sounds like the most technical description of what a task is, so I'm going with that one.
upvoted 0 times
Lorean
2 days ago
A task is a collection of slots.
upvoted 0 times
...
Louann
3 days ago
Tasks get assigned to the executors by the driver.
upvoted 0 times
...
Vanna
4 days ago
I believe a task is a command sent from the driver to the executors in response to a transformation.
upvoted 0 times
...
Albina
7 days ago
I think tasks transform jobs into DAGs.
upvoted 0 times
...
Geraldo
13 days ago
Tasks get assigned to the executors by the driver.
upvoted 0 times
...
Cammy
13 days ago
A task is a collection of slots.
upvoted 0 times
...
Valentin
28 days ago
Tasks transform jobs into DAGs.
upvoted 0 times
...
Avery
1 months ago
I think tasks are commands sent from the driver to the executors.
upvoted 0 times
...
...
Herminia
2 months ago
Hmm, I'm not sure about this one. B sounds like it could be right, but I'm not confident enough to choose that.
upvoted 0 times
...
Vi
2 months ago
I think option E is the correct answer. The driver assigns tasks to the executors, so that makes the most sense.
upvoted 0 times
Glenn
1 months ago
Yes, the driver assigning tasks to the executors makes sense.
upvoted 0 times
...
Reynalda
1 months ago
I agree, option E seems to be the most logical choice.
upvoted 0 times
...
...
Domonique
3 months ago
But tasks are commands, not assignments.
upvoted 0 times
...
Chi
3 months ago
I disagree, I believe the answer is E.
upvoted 0 times
...
Domonique
3 months ago
I think the answer is A.
upvoted 0 times
...

Save Cancel