Hello @Shambhu Rai When using Delta Lake in Databricks, you need to enable column mapping before you can drop columns. Column mapping is a feature that allows metadata-only changes to mark columns as deleted or renamed without rewriting the underlying data files. Enabling column mapping for a table upgrades the Delta table version, and this protocol upgrade is irreversible. Also, please note that tables with column mapping enabled can only be read in Databricks Runtime 10.2 and above. To enable column mapping, execute the following: ALTER TABLE table_name SET TBLPROPERTIES ('delta.columnMapping.mode' = 'name') Once this is successful, you'll be able to drop columns using the ALTER TABLE syntax. For example, if you want to drop a column named "age" in a "students" table, you can execute the following: ALTER TABLE students DROP COLUMNS (age) If the answer is helpful, please click "Accept Answer" and kindly upvote it.
drop a column in databrocks
Shambhu Rai
1,411
Reputation points
HI Expert, how to drop column in databricks ... drop command is not working