cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

docs.databricks.com

Ajay-Pandey
Esteemed Contributor III

Rename and drop columns with Delta Lake column mapping.

Hi all,

Now databricks started supporting column rename and drop.

Column mapping requires the following Delta protocols:

  1. Reader version 2 or above.
  2. Writer version 5 or above.

Blog URL

##Available in Databricks Runtime 10.2 and above.
ALTER TABLE <table_name> RENAME COLUMN old_col_name TO new_col_name
 
##Available in Databricks Runtime 11.0 and above.
ALTER TABLE table_name DROP COLUMN col_name
ALTER TABLE table_name DROP COLUMNS (col_name_1, col_name_2, ...)

Ajay Kumar Pandey
2 REPLIES 2

Ajay-Pandey
Esteemed Contributor III

Sure!

Ajay Kumar Pandey

Poovarasan
New Contributor III

Above mentioned feature is not working in the DLT pipeline. if the scrip has more than 4 columns 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now