A data scientist wants to remove the star_rating column from the Delta table at the location path. To do this, they need to load in data and drop the star_rating column.
Which of the following code blocks accomplishes this task?
A data scientist wants to remove the star_rating column from the Delta table at the location path. To do this, they need to load in data and drop the star_rating column.
Which of the following code blocks accomplishes this task?
To remove a column from a Delta table, the approach involves loading the table into a DataFrame and then utilizing the drop method to remove the specified column. The correct code snippet accomplishes this by using spark.read.format('delta').load(path).drop('star_rating'), which reads the Delta table at the specified path and drops the 'star_rating' column from the resulting DataFrame.
A. spark.read.format(“delta”).load(path).drop(“star_rating”)
This code reads the Delta table located at path, loads it into a DataFrame, and then drops the "star_rating" column from the DataFrame.
A is correct, if it was table_name instead of table_path then D would be correct
A is correct
D is correct: https://docs.databricks.com/en/delta/tutorial.html#read-a-table