Exam Details

  • Exam Code
    :DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK
  • Exam Name
    :Databricks Certified Associate Developer for Apache Spark 3.0
  • Certification
    :Databricks Certifications
  • Vendor
    :Databricks
  • Total Questions
    :180 Q&As
  • Last Updated
    :Jul 02, 2025

Databricks Databricks Certifications DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Questions & Answers

  • Question 61:

    The code block displayed below contains an error. When the code block below has executed, it should have divided DataFrame transactionsDf into 14 parts, based on columns storeId and

    transactionDate (in this order). Find the error.

    Code block:

    transactionsDf.coalesce(14, ("storeId", "transactionDate"))

    A. The parentheses around the column names need to be removed and .select() needs to be appended to the code block.

    B. Operator coalesce needs to be replaced by repartition, the parentheses around the column names need to be removed, and .count() needs to be appended to the code block.

    C. Operator coalesce needs to be replaced by repartition, the parentheses around the column names need to be removed, and .select() needs to be appended to the code block.

    D. Operator coalesce needs to be replaced by repartition and the parentheses around the column names need to be replaced by square brackets.

    E. Operator coalesce needs to be replaced by repartition.

  • Question 62:

    Which of the following describes Spark's Adaptive Query Execution?

    A. Adaptive Query Execution features include dynamically coalescing shuffle partitions, dynamically injecting scan filters, and dynamically optimizing skew joins.

    B. Adaptive Query Execution is enabled in Spark by default.

    C. Adaptive Query Execution reoptimizes queries at execution points.

    D. Adaptive Query Execution features are dynamically switching join strategies and dynamically optimizing skew joins.

    E. Adaptive Query Execution applies to all kinds of queries.

  • Question 63:

    Which of the following code blocks returns a DataFrame that matches the multi-column DataFrame itemsDf, except that integer column itemId has been converted into a string column?

    A. itemsDf.withColumn("itemId", convert("itemId", "string"))

    B. itemsDf.withColumn("itemId", col("itemId").cast("string"))

    C. itemsDf.select(cast("itemId", "string"))

    D. itemsDf.withColumn("itemId", col("itemId").convert("string"))

    E. spark.cast(itemsDf, "itemId", "string")

  • Question 64:

    Which of the following code blocks returns approximately 1000 rows, some of them potentially being duplicates, from the 2000-row DataFrame transactionsDf that only has unique rows?

    A. transactionsDf.sample(True, 0.5)

    B. transactionsDf.take(1000).distinct()

    C. transactionsDf.sample(False, 0.5)

    D. transactionsDf.take(1000)

    E. transactionsDf.sample(True, 0.5, force=True)

  • Question 65:

    Which of the following code blocks returns a single-column DataFrame showing the number of words in column supplier of DataFrame itemsDf?

    Sample of DataFrame itemsDf:

    1.+------+-----------------------------+-------------------+

    2.|itemId|attributes |supplier |

    3.+------+-----------------------------+-------------------+

    4.|1 |[blue, winter, cozy] |Sports Company Inc.|

    5.|2 |[red, summer, fresh, cooling]|YetiX |

    6.|3 |[green, summer, travel] |Sports Company Inc.| 7.+------+-----------------------------+-------------------+

    A. itemsDf.split("supplier", " ").count()

    B. itemsDf.split("supplier", " ").size()

    C. itemsDf.select(word_count("supplier"))

    D. spark.select(size(split(col(supplier), " ")))

    E. itemsDf.select(size(split("supplier", " ")))

  • Question 66:

    Which of the following code blocks immediately removes the previously cached DataFrame transactionsDf from memory and disk?

    A. array_remove(transactionsDf, "*")

    B. transactionsDf.unpersist()

    C. del transactionsDf

    D. transactionsDf.clearCache()

    E. transactionsDf.persist()

  • Question 67:

    The code block shown below should read all files with the file ending .png in directory path into Spark. Choose the answer that correctly fills the blanks in the code block to accomplish this.

    spark.__1__.__2__(__3__).option(__4__, "*.png").__5__(path)

    A. 1. read()

    2.

    format

    3.

    "binaryFile"

    4.

    "recursiveFileLookup"

    5.

    load

    B. 1. read

    2.

    format

    3.

    "binaryFile"

    4.

    "pathGlobFilter"

    5.

    load

    C. 1. read

    2.

    format

    3.

    binaryFile

    4.

    pathGlobFilter

    5.

    load

    D. 1. open

    2.

    format

    3.

    "image"

    4.

    "fileType"

    5.

    open

    E. 1. open

    2.

    as

    3.

    "binaryFile"

    4.

    "pathGlobFilter"

    5.

    load

  • Question 68:

    Which of the following code blocks uses a schema fileSchema to read a parquet file at location filePath into a DataFrame?

    A. spark.read.schema(fileSchema).format("parquet").load(filePath)

    B. spark.read.schema("fileSchema").format("parquet").load(filePath)

    C. spark.read().schema(fileSchema).parquet(filePath)

    D. spark.read().schema(fileSchema).format(parquet).load(filePath)

    E. spark.read.schema(fileSchema).open(filePath)

  • Question 69:

    Which of the following code blocks reads in the parquet file stored at location filePath, given that all columns in the parquet file contain only whole numbers and are stored in the most appropriate

    format for this kind of data?

    A. 1.spark.read.schema(

    2.

    StructType(

    3.

    StructField("transactionId", IntegerType(), True),

    4.

    StructField("predError", IntegerType(), True)

    5.

    )).load(filePath)

    B. 1.spark.read.schema([

    2.

    StructField("transactionId", NumberType(), True),

    3.

    StructField("predError", IntegerType(), True)

    4.

    ]).load(filePath)

    C. 1.spark.read.schema(

    2.

    StructType([

    3.

    StructField("transactionId", StringType(), True),

    4.

    StructField("predError", IntegerType(), True)]

    5.

    )).parquet(filePath)

    D. 1.spark.read.schema(

    2.

    StructType([

    3.

    StructField("transactionId", IntegerType(), True),

    4.

    StructField("predError", IntegerType(), True)]

    5.

    )).format("parquet").load(filePath)

    E. 1.spark.read.schema([

    2.

    StructField("transactionId", IntegerType(), True),

    3.

    StructField("predError", IntegerType(), True)

    4.

    ]).load(filePath, format="parquet")

  • Question 70:

    The code block shown below should return a DataFrame with two columns, itemId and col. In this DataFrame, for each element in column attributes of DataFrame itemDf there should be a separate

    row in which the column itemId contains the associated itemId from DataFrame itemsDf. The new DataFrame should only contain rows for rows in DataFrame itemsDf in which the column attributes

    contains the element cozy.

    A sample of DataFrame itemsDf is below.

    Code block:

    itemsDf.__1__(__2__).__3__(__4__, __5__(__6__))

    A. 1. filter

    2.

    array_contains("cozy")

    3.

    select

    4.

    "itemId"

    5.

    explode

    6.

    "attributes"

    B. 1. where

    2.

    "array_contains(attributes, 'cozy')"

    3.

    select

    4.

    itemId

    5.

    explode

    6.

    attributes

    C. 1. filter

    2.

    "array_contains(attributes, 'cozy')"

    3.

    select

    4.

    "itemId"

    5.

    map

    6.

    "attributes"

    D. 1. filter

    2.

    "array_contains(attributes, cozy)"

    3.

    select

    4.

    "itemId"

    5.

    explode

    6.

    "attributes"

    E. 1. filter

    2.

    "array_contains(attributes, 'cozy')"

    3.

    select

    4.

    "itemId"

    5.

    explode

    6.

    "attributes"

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Databricks exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK exam preparations and Databricks certification application, do not hesitate to visit our Vcedump.com to find your solutions here.