How to import data from parquet files to sql tables where filenames = schema.tablename

Nguyen, Hoa 381 Reputation points
2023-02-07T05:29:37.7366667+00:00

I have several parquet files in Azure storage.

They all have filenames formatted as schemaName.TableName.Parquet

I need to use expressions to load the files to their destination tables.

For ex:

dbo.Client.parquet file IS LOADED to destination table dbo.client
dbo.Table2.parquet file IS LOADED to destination table dbo.Table2
Stage.Table3.parquet file IS LOADED to destination table stage.Table3.

etc...

I have a Get Metadata activity with child items so I can see all the filenames.
I have a linked service to the destination server/database.
I have a generic dataset for the destination sql table.
Do I need a for each with a copy activity?

How do I tell it to use the output of metadata and load to the destination table?

Your help is much appreciated!

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

2 answers

Sort by: Most helpful
  1. Nandan Hegde 34,426 Reputation points MVP
    2023-02-07T06:20:28.03+00:00

    Hey, Please follow the below process 1) use get metadata activity to get filenames 2) pass the output of get metadata activity child items as input to a for each activity 3) within foreach activity use a copy activity with source as blob with filename as item(). Name and sink as sql with table as item(). Name


  2. Nguyen, Hoa 381 Reputation points
    2023-02-13T21:16:32.25+00:00

    For sink, I used the split function to get the Schema name and table name as seen below.
    That worked well for me. Thanks!

    User's image


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.