cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Passing Parameters to Digest MD5 function

rakesh_2004
New Contributor

Hi,

I am trying to read data for multiple tables from SQL server using a parent-child pipeline combination. As part of the process I will also need to determine the CDC. Now i have to sort the data before I send to Diff snap or write my own Logic. As I will be processing multiple tables from the same child pipeline i will not be able to select the fields in the Sort snap for Sort Path because each table will have different primary key columns and some times composite primary keys. So what i was thinking instead to concat the primary key values and then pass them to Digest.MD5 function so that it becomes one single column which i can then use for sorting data and determining CDC. The issue i am facing is if i create a pipeline parameter and pass the fields that needs to be concatenated then it is not working. But if i select the fields in expression builder manually then it is working. How do i pass the values of the strings that needs to be concatenated as parameter?

Working:
โ€œโ€.concat($Emp_ID, $Group_ID) when selected from Source data coming

Not working:

Primary_Key = $Emp_ID, $Group_IDโ€ฆparameter declared in pipeline properties
โ€œโ€.concat(_Primary_Key)โ€ฆIt is creating output of ($Emp_ID, $Group_ID)

2 REPLIES 2

rakesh_2004
New Contributor

I used eval and it seems it will work. But documentation also says it will significantly impact performance. So any better way to do it?

alchemiz
Contributor III

Hi Rakesh,

Pipeline parameter values are set to be as string literal, so in the not working the โ€œโ€.concat(_Primary_Key) is basically just concatenating the โ€œ$Emp_ID, $Group_IDโ€

If you want you can instead use a different approach like split and joinโ€ฆ

in your pipeline parameter set the object the you want to concat e.g. Emp_ID|Group_ID

then in the child pipeline you can do a split and join

_Primary_Key.split(โ€˜|โ€™).map((x) => $.get(x,โ€˜โ€™)).join()

hope this helps ๐Ÿ™‚