Databricks Certified Data Engineer Associate — Question 7

A data analyst has created a Delta table sales that is used by the entire data analysis team. They want help from the data engineering team to implement a series of tests to ensure the data is clean. However, the data engineering team uses Python for its tests rather than SQL.
Which of the following commands could the data engineering team use to access sales in PySpark?

Answer options

Correct answer: E

Explanation

The correct answer is E, as spark.table("sales") allows PySpark to access the Delta table directly. Option A is SQL syntax, which cannot be executed directly in PySpark without using spark.sql(). Option B is incorrect because there are methods to access Delta tables in PySpark. Option C uses the wrong syntax for accessing the table.