Forum Discussion

TWorku's avatar
TWorku
Frequent Visitor
2 years ago
Solved

Data Pipleline : Copy Data : Can we do precedence constraint just like SSIS?

Hello Community 

 

I have a Data Pipeline that includes a task for copying CSV files. My goal is for the pipeline to proceed to the next step only if the copy task successfully copies a file. I initially set it to proceed on success, but even when no files are found and copied, the pipeline still moves to the next task. In SSIS, we have precedence constraints to handle such scenarios. Is there a similar feature in Fabric, or is there a workaround for this issue?

 



Thank YOu

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi TWorku 

     

    To ensure that the file is found and the data is successfully copied before the next action is performed, you can add additional check steps to the pipeline to verify that the replication activity successfully copied the data.

     

    Add another Lookup Activity after the Copy activity to verify if the copied data exists in the destination location.


    Configure the Lookup Activity to check if the copied data exists in the destination location.


    Add an If Condition Activity after the Lookup Activity.


    Configure the If Condition Activity to evaluate the result of the Lookup Activity. The condition should check if the copied data exists in the destination location.


    True Path:
    Add the subsequent pipeline activities. This path will be executed if the Lookup Activity confirms that the data has been successfully copied.


    False Path:
    Add a Fail Activity to handle the scenario where the data was not successfully copied. This ensures that the pipeline does not proceed if the data was not successfully copied.

     

     

     

    Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi TWorku 

     

    To ensure that the file is found and the data is successfully copied before the next action is performed, you can add additional check steps to the pipeline to verify that the replication activity successfully copied the data.

     

    Add another Lookup Activity after the Copy activity to verify if the copied data exists in the destination location.


    Configure the Lookup Activity to check if the copied data exists in the destination location.


    Add an If Condition Activity after the Lookup Activity.


    Configure the If Condition Activity to evaluate the result of the Lookup Activity. The condition should check if the copied data exists in the destination location.


    True Path:
    Add the subsequent pipeline activities. This path will be executed if the Lookup Activity confirms that the data has been successfully copied.


    False Path:
    Add a Fail Activity to handle the scenario where the data was not successfully copied. This ensures that the pipeline does not proceed if the data was not successfully copied.

     

     

     

    Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Can you please confirm what your source is ?
    Ideally the best way would be to validate whether there is any file to copy at the source before proceeding ahead.

    You can use Get meta data activity to check the existence of file, if yes; proceed ahead else skip or fail as per your need

  • you can do the following in Fabric:

    1. Check if the Files Exist: Before you try to copy the files, add a step that checks whether the files are in the source location.

    2. Use an If Condition: After checking for the files, add an If Condition activity. This will let you decide what to do next:

      • If the files are found, go ahead and copy them.
      • If no files are found, skip the copy step or handle the situation differently.
    3. Stop the Pipeline if No Files are Found (Optional): If you want the pipeline to stop when no files are found, you can add a Fail activity inside the Else branch of the If Condition. This will prevent the pipeline from moving forward without files.

    By following these steps, you can control the pipeline flow. i was facing the same isssue with my terabox and solved by 

  • The solution is ok, but it needs multiple activities to achieve it. If constraints would have enabled it would be easier to implement.

  • We can manage it with multiple activities no doubt, but this is increasing the number of activities and also increasing the process time and cost as well. Precedence constraint would help to reduce these. Please check if this can be added in Fabric Data Factory.