Azure Data Factory - delete row in a csv

Gunasekar-Desaiyan 30 Reputation points
2024-12-14T08:35:49.2766667+00:00

I am having some issues with the ADF/Data Flow/Pipeline to delete one row using alterRow.

User's image

I am filtering by ID=1 and deleting ID=1 row. How to include rest of the rows in my final output. I have only 10 rows.

User's image

Even if there is a x mark on the row that is getting deleted, the final sink output to the container, is including the row that was showing deleted x mark.

How will I get the final csv without the ID=1 row and include rest of the rows.

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

2 answers

Sort by: Most helpful
  1. Pinaki Ghatak 5,310 Reputation points Microsoft Employee
    2024-12-16T11:20:48.4266667+00:00

    Hello @Gunasekar-Desaiyan

    To exclude the row with ID=1 from the final output, you can add a Filter transformation after the Alter Row transformation. In the Filter transformation, you can filter out the row with ID=1 using the following expression:

    ID != 1

    This expression will keep all the rows except the row with ID=1. You can then connect the Filter transformation to the sink to output the final CSV file without the row with ID=1.

    Here's an example of how your Mapping Data Flow can be configured:

    1. Add a source to read the CSV file.
    2. Add an Alter Row transformation to delete the row with ID=1.
    3. Add a Filter transformation to exclude the row with ID=1.
    4. Connect the Filter transformation to the sink to output the final CSV file. Please note that the Alter Row transformation only marks the row for deletion and does not actually delete the row. The row will be deleted when the data flow is executed in a pipeline.

    I hope this helps

    0 comments No comments

  2. AnnuKumari-MSFT 33,976 Reputation points Microsoft Employee
    2024-12-17T05:59:34.7933333+00:00

    Hi @Gunasekar-Desaiyan ,

    Thankyou for using Microsoft Q&A platform and thanks for posting your query here.

    I understand that you are trying to delete one row out of 10 records in the source data and dump the remaining 9 into the delta sink.

    Kindly make sure in sink settings, you have selected 'Allow Insert' and 'Allow delete' options :

    User's image

    Hope it helps. Kindly accept the answer by clicking on Accept answer button. Thankyou

    0 comments No comments

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.