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, ...)

3 REPLIES 3

Kaniz_Fatma
Community Manager
Community Manager

Keep sharing such amazing features with the community @Ajay Pandey​ !

Ajay-Pandey
Esteemed Contributor III

Sure!

Poovarasan
New Contributor III

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

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!