
Ultimate access to all questions.
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:
CREATE TABLE new_table
__________
OPTIONS (
header = "true",
delimiter = "|"
)
LOCATION "path/to/csv"
CREATE TABLE new_table
__________
OPTIONS (
header = "true",
delimiter = "|"
)
LOCATION "path/to/csv"
Which of the following lines of code fills in the above blank to successfully complete the task?
A
None of these lines of code are needed to successfully complete the task
B
USING CSV
C
FROM CSV
D
USING DELTA
E
FROM "path/to/csv"
Explanation:
The correct answer is B. USING CSV.
USING clause.CREATE TABLE table_name USING format OPTIONS (...) LOCATION "path"CSV, so USING CSV is the correct syntax.USING clause is required to specify the data source format.USING not FROM for specifying data source format in CREATE TABLE statements.LOCATION clause.CREATE TABLE new_table
USING CSV
OPTIONS (
header = "true",
delimiter = "|"
)
LOCATION "path/to/csv"
CREATE TABLE new_table
USING CSV
OPTIONS (
header = "true",
delimiter = "|"
)
LOCATION "path/to/csv"
This syntax creates an external table that reads data from the CSV file at the specified location with the given options (header=true and pipe delimiter).