How can I copy data from multiple subfolders as parquet tables in a folder with same subfolder name using Azure Data Factory?

Abhijit M 1 Reputation point

I have a folder sturucture like:

Folder_1/Sub_Folder_1------>file_1_1.txt, file_1_2.txt, file_1_3.csv

Folder_1/Sub_Folder_2------>file_2_1.txt, file_2_2.txt

Folder_1/Sub_Folder_3------>file_3_1.txt, file_3_2.txt


Folder_1/Sub_Folder_5------>file_5_1.csv, file_5_2.csv, file_5_3.csv


I want to pick these files and save them as parquet table but the files from sub_folder_2 must be stored in the directory with same name i.e. sub_folder_2

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
8,520 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Nasreen Akter 10,706 Reputation points

    Hi @

    Thank you for the ask.

    In the CopyActivity, there is an option in the SINK --> Copy Behavior --> Preserve Hierarchy which will give you the desire output. Thanks!