Data flow Sink file name option

N2120 81 Reputation points
2022-10-14T05:33:22.48+00:00

250314-capture.jpg

In the data flow sink File Name option, is there a way to dynamically add the partition number to the file name
as below concat('FileName_'[n],'.csv')
where [n] is partition number

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

Accepted answer
  1. Subashri Vasudevan 11,206 Reputation points
    2022-10-19T06:18:40.94+00:00

    Hi @N2120

    Please use the below expression in the pattern text box

    concat('filename', toString(currentTimestamp(),'yyyyMMddHHmmss'),'-[n].csv')

    251846-screenshot-2022-10-19-at-114750-am.png

    It works as expected.

    251808-screenshot-2022-10-19-at-114648-am.png

    Please let me know for questions, and if it works, please dont forget to accept it as answer and to upvote.

    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Subashri Vasudevan 11,206 Reputation points
    2022-10-18T12:58:58.28+00:00

    Hi @N2120

    You can choose pattern in the file name option
    instead of per partition, and type like below

    Filename[n].CSV

    This will be creating the files like below

    1. Filename1.csv
    2. Filename2.csv
    3. Filename3.csv

    Where 1,2,3 are the partiton numbers.

    Please let us know if it answers your question.

    For an example, you may go thru this below link.

    Thanks

    1 person found this answer helpful.

  2. N2120 81 Reputation points
    2022-10-18T15:19:52.37+00:00

    @Subashri Vasudevan

    Thanks for your response. Did something change after that article was written.
    When I type the same thing after choosing pattern, it says expression cannot be evaluated.
    pls see screenshot251655-filen.jpg


  3. N2120 81 Reputation points
    2022-10-18T16:01:23.617+00:00

    @Subashri Vasudevan I need to evaluate it as a dynamic expression as my file name needs to concatenate the time it generates the file
    so it should be of format fileName_partition number_HHMMSS.csv


  4. N2120 81 Reputation points
    2022-10-20T05:17:57.363+00:00

    @Subashri Vasudevan Thanks so much for your help. It worked.


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.