Databricks Certified Data Engineer Associate · Free Practice Question Medium

Question 23

A data analyst has developed a query that runs against Delta table. They want help from the data engineering team to implement a series of tests to ensure the data returned by the query is clean. However, the data engineering team uses Python for its tests rather than SQL. Which of the following operations could the data engineering team use to run the query and operate with the results in PySpark?

  • A

    spark.sql

  • B

    spark.table

  • C

    SELECT * FROM sales

  • D There is no way to share data between PySpark and SQL.
  • E

    spark.delta.table

Reveal correct answer

Correct answer: A

Explanation

spark.sql, allows you to run SQL queries within a PySpark context, which includes accessing and querying Delta tables. This option is more versatile and directly supports running the original SQL query developed by the data analyst, making it a suitable choice for performing data quality tests on the Delta table.

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