Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Certified Associate Developer for Apache Spark All Questions

View all questions & answers for the Certified Associate Developer for Apache Spark exam

Exam Certified Associate Developer for Apache Spark topic 1 question 84 discussion

The code block shown below should use SQL to return a new DataFrame containing column storeId and column managerName from a table created from DataFrame storesDF. Choose the response that correctly fills in the numbered blanks within the code block to complete this task.

Code block:

__1__.__2__("stores")
__3__.__4__("SELECT storeId, managerName FROM stores")

  • A. 1. spark
    2. createOrReplaceTempView
    3. storesDF
    4. query
  • B. 1. spark
    2. createTable
    3. storesDF
    4. sql
  • C. 1. storesDF
    2. createOrReplaceTempView
    3. spark
    4. query
  • D. 1. spark
    2. createOrReplaceTempView
    3. storesDF
    4. sql
  • E. 1. storesDF
    2. createOrReplaceTempView
    3. spark
    4. sql
Show Suggested Answer Hide Answer
Suggested Answer: E 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
6546a53
3 months, 1 week ago
Selected Answer: E
It's E
upvoted 1 times
...
Samir_91
5 months, 3 weeks ago
Selected Answer: E
It's E
upvoted 1 times
...
Sowwy1
7 months, 3 weeks ago
It's E
upvoted 1 times
...
Sowwy1
7 months, 3 weeks ago
It's E. df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) df.createTempView("people") df2 = spark.sql("SELECT * FROM people")
upvoted 3 times
...
tangerine141
9 months ago
Selected Answer: D
spark.createOrReplaceTempView("stores") storesDF.sql("SELECT storeId, managerName FROM stores")
upvoted 1 times
Samir_91
5 months, 3 weeks ago
spark.createOrReplaceTempView("stores") gives an error AttributeError: 'SparkSession' object has no attribute 'createOrReplaceTempView'
upvoted 1 times
...
naman405verma
9 months ago
no Bro https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.DataFrame.createTempView.html check this E is correct only
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...