Renaming a produced file in delta format - Synapse Analytics

pmscorca 1,052 Reputation points
2023-04-18T14:51:59.5966667+00:00

Hi, in Synapse Analytics I've implemented a data flow to read a csv source file and produced a sink file in delta format. If possible, I'd like to rename the produced parquet file in order to assign a meaningful name. Any suggests to me, please?
User's image

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,375 questions
{count} vote

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 90,641 Reputation points Moderator
    2023-04-19T06:22:39.61+00:00


    pmscorca
    - Thanks for the question and using MS Q&A platform.

    You can use Microsoft Spark Utilities - to rename file.

    mssparkutils.fs provides utilities for working with various file systems, including Azure Data Lake Storage Gen2 (ADLS Gen2) and Azure Blob Storage.

    To demo practically, I had a part-00000 file in the delta folder as shown below:
    User's image

    Utilized mssparkutils.fs.mv command to rename the part-00000 file with the meaning full name as per your requirement.

    old_name = r"abfss://******@cheprasynapse.dfs.core.windows.net/delta/delta-table-0/part-00000-dfd2415b-7a09-4e61-a8e5-96e9f38dc367-c000.snappy.parquet"
    new_name = r"abfss://******@cheprasynapse.dfs.core.windows.net/delta/delta-table-0/pradeep.snappy.parquet"
    
    mssparkutils.fs.mv(old_name, new_name)
    

    User's image

    We had successfully renamed part-00000 file with the meaning full name as per your requirement. User's image

    Hope this helps. Do let us know if you any further queries.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.