QuestionQ84

VerifiedData Governance & Quality

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?

Explanation

Use spark.table("sales") (E) to obtain the registered table as a PySpark DataFrame and apply Python-based tests. spark.sql() also supports SQL from Python, but it requires a valid SQL query such as SELECT * FROM sales, not the table name alone as in C. A is SQL text rather than a PySpark expression as written; B is false because SQL and PySpark can access registered tables; D is not a SparkSession table-access API.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!