
Answer-first summary for fast verification
Answer: spark.read.format("delta").load("/path/to/table").show()
The correct method to query a Delta Lake table using Spark SQL directly is option C: `spark.read.format("delta").load("/path/to/table").show()`. This approach correctly specifies the Delta format and the path to the table, then displays the data with `.show()`. Options A and D are incorrect because they misuse the syntax for Delta Lake queries. Option B is a SQL query that doesn't specify the correct format or path for Delta Lake.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can you directly query a Delta Lake table using Spark SQL?
A
spark.read.delta("/path/to/table").sql("SELECT * FROM table")
B
spark.sql("SELECT * FROM delta_table").show()
C
spark.read.format("delta").load("/path/to/table").show()
D
spark.sql("SELECT * FROM delta./path/to/table")
No comments yet.