LeetQuiz Logo
Privacy Policy•contact@leetquiz.com
© 2025 LeetQuiz All rights reserved.
Databricks Certified Data Engineer - Associate

Databricks Certified Data Engineer - Associate

Get started today

Ultimate access to all questions.


Assume you have a DataFrame df loaded from a CSV file located at '/data/sales.csv' with columns 'id', 'product', 'quantity', and 'price'. You need to create a temporary view named 'sales_view' that can be used in subsequent SQL queries. How would you achieve this using PySpark?

Simulated



Explanation:

The correct answer is A because it correctly uses the 'createOrReplaceTempView' method to create a temporary view named 'sales_view' that can be used in subsequent SQL queries. This method ensures that the view is always up-to-date with the DataFrame.

Powered ByGPT-5