change column name in delta parquet file

arkiboys 9,596 Reputation points
2023-01-28T16:25:23.9866667+00:00

hello,
data fatory data flow is being used to upsert into delta parquet files.
The delta parquet files have several columns.
How is it possible to change the name of a column without affecting the data using the delta sink in the data flow?
for example, Columnc should be Column_C

Thank you

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,515 questions
{count} votes

1 answer

Sort by: Most helpful
  1. BhargavaGunnam-MSFT 25,971 Reputation points Microsoft Employee
    2023-02-01T21:07:53.7466667+00:00

    Hello @arkiboys,

    Thanks for the details.

    In your case, you need to update the column name of your delta table.

    When column mapping is enabled for a Delta table, you can rename a column using the below syntax;

    SQL

    
    ALTER TABLE <table_name> RENAME COLUMN old_col_name TO new_col_name
    

    Reference document: https://docs.databricks.com/delta/delta-column-mapping.html#:~:text=When%20%EE%80%80column%EE%80%81%20mapping%20is%20enabled%20for%20a%20%EE%80%80Delta%EE%80%81,Note%20Available%20in%20Databricks%20Runtime%2011.0%20and%20above.

    Also, I found this blog helpful.

    I hope this helps. Please let me know if you have any further questions.