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 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group