DATABRICKS-CERTIFIED-DATA-ENGINEER-ASSOCIATE · Question #80
A data engineer needs to create a table in Databricks using data from a CSV file at location /path/to/csv. They run the following command: Which of the following lines of code fills in the above…
The correct answer is B. USING CSV. In Spark SQL, when creating a table from an external file format, the USING clause specifies the data source format. The correct syntax is CREATE TABLE table_name USING CSV LOCATION '/path/to/csv'. The USING keyword tells Spark SQL what format the underlying data is in so it…
Question
Exhibit
Options
- ANone of these lines of code are needed to successfully complete the task
- BUSING CSV
- CFROM CSV
- DUSING DELTA
- EFROM "path/to/csv"
How the community answered
(53 responses)- A4% (2)
- B94% (50)
- E2% (1)
Explanation
In Spark SQL, when creating a table from an external file format, the USING clause specifies the data source format. The correct syntax is CREATE TABLE table_name USING CSV LOCATION '/path/to/csv'. The USING keyword tells Spark SQL what format the underlying data is in so it can read it correctly. FROM CSV and FROM 'path/to/csv' are not valid Spark SQL syntax for CREATE TABLE. USING DELTA would apply only if the data were in Delta format, not CSV. 'None of these' is incorrect because the format declaration is required.
Topics
Community Discussion
No community discussion yet for this question.
