Databricks Certified Associate Developer For Apache Spark 30 · Free Practice Question Easy

Question 6

Which of the following code blocks merges two DataFrames df1 and df2 ?

  • A

    df1.appendAll(df2)

  • B

    df1.append(df2)

  • C

    df1.add(df2)

  • D

    df1.addAll(df2)

  • E

    df1.merge(df2)

  • F

    df1.union(df2)

Reveal correct answer

Correct answer: F

Explanation

DataFrames are immutable. This means users cannot append to DataFrames because that would be changing it. To append to a DataFrame, you must union the original DataFrame along with the new DataFrame.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need