
Answer-first summary for fast verification
Answer: The record will not be inserted into the table, and an error message will be displayed.
When attempting to insert data into the `venues` table, an error will be displayed: `AnalysisException: Cannot insert into dbfs:/FileStore/data/venues.csv, as it is a file instead of a directory.` This occurs because the table was created using `dbfs:/FileStore/data/venues.csv` as the `LOCATION`, which does not allow for new records to be inserted. To enable record insertion, the table should be created with `dbfs:/FileStore/data/` as the `LOCATION`, allowing new records to be added to the table and a new CSV file to be created in the directory.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
A data engineer is tasked with creating a table from a CSV file stored in local storage. After successfully creating the table with the SQL statement CREATE TABLE venues(name STRING, area INT) USING CSV LOCATION 'dbfs:/FileStore/data/venues.csv', the engineer attempts to add a record using the INSERT INTO command. What will be the outcome of this command?
A
The record will be inserted into the venues table and a new CSV file will be created in the dbfs:/FileStore/data/ directory.
B
The record will not be inserted into the table, and an error message will be displayed.
C
The record will be inserted into both the table and the venues.csv file.
D
The record will not be inserted into the table, but an OK message will be displayed.
E
The record will be inserted into the venues.csv file but not into the venues table.
No comments yet.