Databricks Certified Associate Developer for Apache Spark Databricks Certified Associate Developer for Apache Spark 3.0 Exam Questions in PDF

Free Databricks Databricks Certified Associate Developer for Apache Spark 3.0 Dumps Questions (page: 5)

Which of the following code blocks can be used to save DataFrame transactionsDf to memory only, recalculating partitions that do not fit in memory when they are needed?

  1. from pyspark import StorageLevel transactionsDf.cache(StorageLevel.MEMORY_ONLY)
  2. transactionsDf.cache()
  3. transactionsDf.storage_level('MEMORY_ONLY')
  4. transactionsDf.persist()
  5. transactionsDf.clear_persist()
  6. from pyspark import StorageLevel transactionsDf.persist(StorageLevel.MEMORY_ONLY)

Answer(s): F

Explanation:

from pyspark import StorageLevel transactionsDf.persist(StorageLevel.MEMORY_ONLY)
Correct. Note that the storage level MEMORY_ONLY means that all partitions that do not fit into memory will be recomputed when they are needed.
transactionsDf.cache()
This is wrong because the default storage level of DataFrame.cache() is MEMORY_AND_DISK, meaning that partitions that do not fit into memory are stored on disk.
transactionsDf.persist()
This is wrong because the default storage level of DataFrame.persist() is MEMORY_AND_DISK. transactionsDf.clear_persist()
Incorrect, since clear_persist() is not a method of DataFrame. transactionsDf.storage_level('MEMORY_ONLY')
Wrong. storage_level is not a method of DataFrame.
More info: RDD Programming Guide - Spark 3.0.0 Documentation, pyspark.sql.DataFrame.persist —
PySpark 3.0.0 documentation (https://bit.ly/3sxHLVC , https://bit.ly/3j2N6B9)



The code block displayed below contains an error. The code block should create DataFrame itemsAttributesDf which has columns itemId and attribute and lists every attribute from the attributes column in DataFrame itemsDf next to the itemId of the respective row in itemsDf. Find the error.
A sample of DataFrame itemsDf is below.

Code block:
itemsAttributesDf = itemsDf.explode("attributes").alias("attribute").select("attribute", "itemId")

  1. Since itemId is the index, it does not need to be an argument to the select() method.
  2. The alias() method needs to be called after the select() method.
  3. The explode() method expects a Column object rather than a string.
  4. explode() is not a method of DataFrame. explode() should be used inside the select() method instead.
  5. The split() method should be used inside the select() method instead of the explode() method.

Answer(s): D

Explanation:

The correct code block looks like this:

Then, the first couple of rows of itemAttributesDf look like this:

explode() is not a method of DataFrame. explode() should be used inside the select() method instead.
This is correct.
The split() method should be used inside the select() method instead of the explode() method.
No, the split() method is used to split strings into parts. However, column attributs is an array of strings. In this case, the explode() method is appropriate.
Since itemId is the index, it does not need to be an argument to the select() method. No, itemId still needs to be selected, whether it is used as an index or not.
The explode() method expects a Column object rather than a string.
No, a string works just fine here. This being said, there are some valid alternatives to passing in a string:

The alias() method needs to be called after the select() method. No.
More info: pyspark.sql.functions.explode — PySpark 3.1.1 documentation (https://bit.ly/2QUZI1J) Static notebook | Dynamic notebook: See test 1, Question: 22 (
Databricks import instructions) (https://flrs.github.io/spark_practice_tests_code/#1/22.html , https://bit.ly/sparkpracticeexams_import_instructions)



Which of the following code blocks reads in parquet file /FileStore/imports.parquet as a DataFrame?

  1. spark.mode("parquet").read("/FileStore/imports.parquet")
  2. spark.read.path("/FileStore/imports.parquet", source="parquet")
  3. spark.read().parquet("/FileStore/imports.parquet")
  4. spark.read.parquet("/FileStore/imports.parquet")
  5. spark.read().format('parquet').open("/FileStore/imports.parquet")

Answer(s): D

Explanation:

Static notebook | Dynamic notebook: See test 1, Question: 23 (
Databricks import instructions) (https://flrs.github.io/spark_practice_tests_code/#1/23.html ,
https://bit.ly/sparkpracticeexams_import_instructions)



The code block shown below should convert up to 5 rows in DataFrame transactionsDf that have the value 25 in column storeId into a Python list. Choose the answer that correctly fills the blanks in the code block to accomplish this. Code block:
transactionsDf. 1 ( 2 ). 3 ( 4 )

  1. 1. filter
    2. "storeId"==25
    3. collect 4. 5
  2. 1. filter
    2. col("storeId")==25
    3. toLocalIterator 4. 5
  3. 1. select
    2. storeId==25
    3. head 4. 5
  4. 1. filter
    2. col("storeId")==25
    3. take 4. 5
  5. 1. filter
    2. col("storeId")==25
    3. collect 4. 5

Answer(s): D

Explanation:

The correct code block is: transactionsDf.filter(col("storeId")==25).take(5)
Any of the options with collect will not work because collect does not take any arguments, and in both cases the argument 5 is given.
The option with toLocalIterator will not work because the only argument to toLocalIterator is prefetchPartitions which is a boolean, so passing 5 here does not make sense.
The option using head will not work because the expression passed to select is not proper syntax. It would work if the expression would be col("storeId")==25.
Static notebook | Dynamic notebook: See test 1, Question: 24 (
Databricks import instructions) (https://flrs.github.io/spark_practice_tests_code/#1/24.html ,
https://bit.ly/sparkpracticeexams_import_instructions)



Which of the following code blocks reads JSON file imports.json into a DataFrame?

  1. spark.read().mode("json").path("/FileStore/imports.json")
  2. spark.read.format("json").path("/FileStore/imports.json")
  3. spark.read("json", "/FileStore/imports.json")
  4. spark.read.json("/FileStore/imports.json")
  5. spark.read().json("/FileStore/imports.json")

Answer(s): D

Explanation:

Static notebook | Dynamic notebook: See test 1, Question: 25 (
Databricks import instructions) (https://flrs.github.io/spark_practice_tests_code/#1/25.html ,
https://bit.ly/sparkpracticeexams_import_instructions)



Share your comments for Databricks Databricks Certified Associate Developer for Apache Spark 3.0 exam with other users:

B
Biswa
11/20/2023 9:28:00 AM

understand sql col.

S
Saint Pierre
10/24/2023 6:21:00 AM

i would give 5 stars to this website as i studied for az-800 exam from here. it has all the relevant material available for preparation. i got 890/1000 on the test.

R
Rose
7/24/2023 2:16:00 PM

this is nice.

A
anon
10/15/2023 12:21:00 PM

q55- the ridac workflow can be modified using flow designer, correct answer is d not a

N
NanoTek3
6/13/2022 10:44:00 PM

by far this is the most accurate exam dumps i have ever purchased. all questions are in the exam. i saw almost 90% of the questions word by word.

E
eriy
11/9/2023 5:12:00 AM

i cleared the az-104 exam by scoring 930/1000 on the exam. it was all possible due to this platform as it provides premium quality service. thank you!

M
Muhammad Rawish Siddiqui
12/8/2023 8:12:00 PM

question # 232: accessibility, privacy, and innovation are not data quality dimensions.

V
Venkat
12/27/2023 9:04:00 AM

looks wrong answer for 443 question, please check and update

V
Varun
10/29/2023 9:11:00 PM

great question

D
Doc
10/29/2023 9:36:00 PM

question: a user wants to start a recruiting posting job posting. what must occur before the posting process can begin? 3 ans: comment- option e is incorrect reason: as part of enablement steps, sap recommends that to be able to post jobs to a job board, a user need to have the correct permission and secondly, be associated with one posting profile at minimum

I
It‘s not A
9/17/2023 5:31:00 PM

answer to question 72 is d [sys_user_role]

I
indira m
8/14/2023 12:15:00 PM

please provide the pdf

R
ribrahim
8/1/2023 6:05:00 AM

hey guys, just to let you all know that i cleared my 312-38 today within 1 hr with 100 questions and passed. thank you so much brain-dumps.net all the questions that ive studied in this dump came out exactly the same word for word "verbatim". you rock brain-dumps.net!!! section name total score gained score network perimeter protection 16 11 incident response 10 8 enterprise virtual, cloud, and wireless network protection 12 8 application and data protection 13 10 network défense management 10 9 endpoint protection 15 12 incident d

A
Andrew
8/23/2023 6:02:00 PM

very helpful

L
latha
9/7/2023 8:14:00 AM

useful questions

I
ibrahim
11/9/2023 7:57:00 AM

page :20 https://exam-dumps.com/snowflake/free-cof-c02-braindumps.html?p=20#collapse_453 q 74: true or false: pipes can be suspended and resumed. true. desc.: pausing or resuming pipes in addition to the pipe owner, a role that has the following minimum permissions can pause or resume the pipe https://docs.snowflake.com/en/user-guide/data-load-snowpipe-intro

F
Franklin Allagoa
7/5/2023 5:16:00 AM

i want hcia exam dumps

S
SSA
12/24/2023 1:18:00 PM

good training

B
BK
8/11/2023 12:23:00 PM

very useful

D
Deepika Narayanan
7/13/2023 11:05:00 PM

yes need this exam dumps

B
Blessious Phiri
8/15/2023 3:31:00 PM

these questions are a great eye opener

J
Jagdesh
9/8/2023 8:17:00 AM

thank you for providing these questions and answers. they helped me pass my exam. you guys are great.

T
TS
7/18/2023 3:32:00 PM

good knowledge

A
Asad Khan
11/1/2023 2:44:00 AM

answer 10 should be a because only a new project will be created & the organization is the same.

R
Raj
9/12/2023 3:49:00 PM

can you please upload the dump again

C
Christian Klein
6/23/2023 1:32:00 PM

is it legit questions from sap certifications ?

A
anonymous
1/12/2024 3:34:00 PM

question 16 should be b (changing the connector settings on the monitor) pc and monitor were powered on. the lights on the pc are on indicating power. the monitor is showing an error text indicating that it is receiving power too. this is a clear sign of having the wrong input selected on the monitor. thus, the "connector setting" needs to be switched from hdmi to display port on the monitor so it receives the signal from the pc, or the other way around (display port to hdmi).

N
NSPK
1/18/2024 10:26:00 AM

q 10. ans is d (in the target org: open deployment settings, click edit next to the source org. select allow inbound changes and save

M
mohamed abdo
9/1/2023 4:59:00 AM

very useful

T
Tom
3/18/2022 8:00:00 PM

i purchased this exam dumps from another website with way more questions but they were all invalid and outdate. this exam dumps was right to the point and all from recent exam. it was a hard pass.

E
Edrick GOP
10/24/2023 6:00:00 AM

it was a good experience and i got 90% in the 200-901 exam.

A
anonymous
8/10/2023 2:28:00 AM

hi please upload this

B
Bakir
7/6/2023 7:24:00 AM

please upload it

A
Aman
6/18/2023 1:27:00 PM

really need this dump. can you please help.

AI Tutor 👋 I’m here to help!