1
votes

I am performing a a trigger based pipeline to copy data from blob storage to SQL database. In every blob file there are bunch of JSONs from which I need to copy just few of them and I can differenciate them on the basis of a Key-value pair present in every JSON.

So How to filter those JSON containing that Value corresponding to a common key?

One Blob file looks like this. Now While the copy activity is happening ,it should filter data according to the Event- Name: "...".

Inside BLOB File example (5 json present)

2

2 Answers

0
votes

Data factory in general only moves data, it doesnt modify it. What you are trying to do might be done using a staging table in the sink sql.

You should first load the json values as-is from the blob storage in the staging table, then copy it from the staging table to the real table where you need it, applying your logic to filter in the sql command used to extract it.

Remember that sql databases have built in functions to treat json values: https://docs.microsoft.com/en-us/sql/relational-databases/json/json-data-sql-server?view=sql-server-2017

Hope this helped!

-1
votes

At this time we do not have an option for the copy activity to filter the content( with an exception of sql source ) . In your scenario it looks like that already know which values needs to omitted , on way to go will be have a "Stored Procedure" activity , after the copy activity which will be just delete the values which you don't want from the table ,this should be easy to implement but depending on the volume of data it may lead to performance issues . The other option is to have the JSON file cleaned on the storage side before it is ingested .