QuestionQ96

VerifiedUsing Spark SQL

The code block below must use SQL to return a new DataFrame that contains the storeId and managerName columns from a table created from the storesDF DataFrame. Choose the response that correctly fills the numbered blanks in the code block to complete this task.

Code block:

1.2("stores")

3.4("SELECT storeId, managerName FROM stores")

Explanation

createOrReplaceTempView is a DataFrame method that registers storesDF as the temporary view named stores. SparkSession.sql executes the SELECT statement against that view and returns its result as a DataFrame. DataFrame.createOrReplaceTempView, SparkSession.sql

Learn more

Community Discussion

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