DATABRICKS-CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK 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 12, 2026

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

  • Question 141:

    Which of the following code blocks creates a new DataFrame with two columns season and wind_speed_ms where column season is of data type string and column wind_speed_ms is of data type double?

    A. spark.DataFrame({"season": ["winter","summer"], "wind_speed_ms": [4.5, 7.5]})
    B. spark.createDataFrame([("summer", 4.5), ("winter", 7.5)], ["season", "wind_speed_ms"])
    C. 1. from pyspark.sql import types as T 2. spark.createDataFrame((("summer", 4.5), ("winter", 7.5)),
    D. StructType([T.StructField("season", T.CharType()), T.StructField("season",
    E. DoubleType())]))
    F. spark.newDataFrame([("summer", 4.5), ("winter", 7.5)], ["season", "wind_speed_ms"])
    G. spark.createDataFrame({"season": ["winter","summer"], "wind_speed_ms": [4.5, 7.5]})

  • Question 142:

    Which of the following code blocks creates a new 6-column DataFrame by appending the rows of the 6-column DataFrame yesterdayTransactionsDf to the rows of the 6-column DataFrame todayTransactionsDf, ignoring that both DataFrames have different column names?

    A. union(todayTransactionsDf, yesterdayTransactionsDf)
    B. todayTransactionsDf.unionByName(yesterdayTransactionsDf, allowMissingColumns=True)
    C. todayTransactionsDf.unionByName(yesterdayTransactionsDf)
    D. todayTransactionsDf.concat(yesterdayTransactionsDf)
    E. todayTransactionsDf.union(yesterdayTransactionsDf)

  • Question 143:

    The code block displayed below contains an error. The code block is intended to return all columns of DataFrame transactionsDf except for columns predError, productId, and value.

    Find the error.

    Excerpt of DataFrame transactionsDf:

    transactionsDf.select(~col("predError"), ~col("productId"), ~col("value"))

    A. The select operator should be replaced by the drop operator and the arguments to the drop operator should be column names predError, productId and value wrapped in the col operator so they should be expressed like drop(col(predError), col(productId), col(value)).
    B. The select operator should be replaced with the deselect operator.
    C. The column names in the select operator should not be strings and wrapped in the col operator, so they should be expressed like select(~col(predError), ~col(productId), ~col(value)).
    D. The select operator should be replaced by the drop operator.
    E. The select operator should be replaced by the drop operator and the arguments to the drop operator should be column names predError, productId and value as strings.

  • Question 144:

    The code block displayed below contains multiple errors. The code block should return a DataFrame that contains only columns transactionId, predError, value and storeId of DataFrame

    transactionsDf. Find the errors.

    Code block:

    transactionsDf.select([col(productId), col(f)])

    Sample of transactionsDf:

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

    2.|transactionId|predError|value|storeId|productId| f| 3.+-------------+---------+-----+-------+---------+----+

    4.| 1| 3| 4| 25| 1|null|

    5.| 2| 6| 7| 2| 2|null|

    6.| 3| 3| null| 25| 3|null|

    7.+-------------+---------+-----+-------+---------+----+

    A. The column names should be listed directly as arguments to the operator and not as a list.
    B. The select operator should be replaced by a drop operator, the column names should be listed directly as arguments to the operator and not as a list, and all column names should be expressed as strings without being wrapped in a col() operator.
    C. The select operator should be replaced by a drop operator.
    D. The column names should be listed directly as arguments to the operator and not as a list and following the pattern of how column names are expressed in the code block, columns productId and f should be replaced by transactionId, predError, value and storeId.
    E. The select operator should be replaced by a drop operator, the column names should be listed directly as arguments to the operator and not as a list, and all col() operators should be removed.

  • Question 145:

    Which of the following code blocks returns a copy of DataFrame transactionsDf where the column storeId has been converted to string type?

    A. transactionsDf.withColumn("storeId", convert("storeId", "string"))
    B. transactionsDf.withColumn("storeId", col("storeId", "string"))
    C. transactionsDf.withColumn("storeId", col("storeId").convert("string"))
    D. transactionsDf.withColumn("storeId", col("storeId").cast("string"))
    E. transactionsDf.withColumn("storeId", convert("storeId").as("string"))

  • Question 146:

    The code block displayed below contains an error. The code block should return DataFrame transactionsDf, but with the column storeId renamed to storeNumber. Find the error.

    Code block:

    transactionsDf.withColumn("storeNumber", "storeId")

    A. Instead of withColumn, the withColumnRenamed method should be used.
    B. Arguments "storeNumber" and "storeId" each need to be wrapped in a col() operator.
    C. Argument "storeId" should be the first and argument "storeNumber" should be the second argument to the withColumn method.
    D. The withColumn operator should be replaced with the copyDataFrame operator.
    E. Instead of withColumn, the withColumnRenamed method should be used and argument "storeId" should be the first and argument "storeNumber" should be the second argument to that method.

  • Question 147:

    The code block displayed below contains multiple errors. The code block should remove column transactionDate from DataFrame transactionsDf and add a column transactionTimestamp in which

    dates that are expressed as strings in column transactionDate of DataFrame transactionsDf are converted into unix timestamps. Find the errors.

    Sample of DataFrame transactionsDf:

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

    2.|transactionId|predError|value|storeId|productId| f| transactionDate|

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

    4.| 1| 3| 4| 25| 1|null|2020-04-26 15:35|

    5.| 2| 6| 7| 2| 2|null|2020-04-13 22:01|

    6.| 3| 3| null| 25| 3|null|2020-04-02 10:53|

    7.+-------------+---------+-----+-------+---------+----+----------------+

    Code block:

    1.transactionsDf = transactionsDf.drop("transactionDate")

    2.transactionsDf["transactionTimestamp"] = unix_timestamp("transactionDate", "yyyy-MM- dd")

    A. Column transactionDate should be dropped after transactionTimestamp has been written. The string indicating the date format should be adjusted. The withColumn operator should be used instead of the existing column assignment. Operator to_unixtime() should be used instead of unix_timestamp().
    B. Column transactionDate should be dropped after transactionTimestamp has been written. The withColumn operator should be used instead of the existing column assignment. Column transactionDate should be wrapped in a col() operator.
    C. Column transactionDate should be wrapped in a col() operator.
    D. The string indicating the date format should be adjusted. The withColumnReplaced operator should be used instead of the drop and assign pattern in the code block to replace column transactionDate with the new column transactionTimestamp.
    E. Column transactionDate should be dropped after transactionTimestamp has been written. The string indicating the date format should be adjusted. The withColumn operator should be used instead of the existing column assignment.

  • Question 148:

    Which of the following statements about reducing out-of-memory errors is incorrect?

    A. Concatenating multiple string columns into a single column may guard against out-of- memory errors.
    B. Reducing partition size can help against out-of-memory errors.
    C. Limiting the amount of data being automatically broadcast in joins can help against out- of-memory errors.
    D. Setting a limit on the maximum size of serialized data returned to the driver may help prevent out-of-memory errors.
    E. Decreasing the number of cores available to each executor can help against out-of- memory errors.

  • Question 149:

    Which of the following code blocks shuffles DataFrame transactionsDf, which has 8 partitions, so that it has 10 partitions?

    A. transactionsDf.repartition(transactionsDf.getNumPartitions()+2)
    B. transactionsDf.repartition(transactionsDf.rdd.getNumPartitions()+2)
    C. transactionsDf.coalesce(10)
    D. transactionsDf.coalesce(transactionsDf.getNumPartitions()+2)
    E. transactionsDf.repartition(transactionsDf._partitions+2)

  • Question 150:

    Which of the following DataFrame operators is never classified as a wide transformation?

    A. DataFrame.sort()
    B. DataFrame.aggregate()
    C. DataFrame.repartition()
    D. DataFrame.select()
    E. DataFrame.join()

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.