Databricks Certified Data Engineer Associate — Question 102

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?

Answer options

Correct answer: C

Explanation

The correct answer is C, as spark.sql allows the data engineering team to execute SQL queries within a PySpark context. Options A and D do not provide the necessary functionality to run SQL queries in PySpark, and option B is specific to accessing Delta tables but does not execute SQL commands.