generate Unique sequence numbers for each partition in session with Unconnected Lookup ?




Hi All,

Please help me to resolve the below issue while Applying partitioning concept to my Session.

This is a very simple mapping with Source, Lookup , router, and target.

I need to Lookup on the target and compare with the source data, if any piece of data is new then Insert, and If any thing change in the existed data then Update.

while Inserting the new records to the target table I'm generating sequence numbers with Unconnected lookup, by calling the maximum PK ID from the target table.

The above flow is working fine from last one year.

Now I wish to apply the Partitioning concept to the above floe(session)

At source I used 4 pass through partitions.(For Each partition different filter conditions to pull the data from source)

at Target I used 4 passthrough Partitions.

it is working fine for some data, but for some rows for Insert Operation , it is throwing Unique key errors, because while Inserting the data it is generating the same sequence key twice.


In detail : 1st row is coming from 1st partition and generated the sequence number 1 for that row.

2nd row is coming from 1st partition and generated the sequence number 2 for that row

3rd row is coming from the 2nd partition generated the sequence number 2 again for that row. (it must generate 3 for this row)

the issue is becuase of generating the same sequence numbers twice for different partitions.

Can any one Please help me to resolve this issue.

While Applying partitions how can I generate a Unique Sequence numbers from Unconnected lookup for Each partitioned data.


Regrads,
N Kiran.

Answer Posted / subhrangshu

Hi,
Take one parameter (i.e. $$seq) and assign initial value for the unique key (i.e. 1000). Now, from Source Qualifier take all the ports to one expression transformation. Add two additional ports in the Expression Transformation as below.

v_seq (variable port) = IIF(v_seq>0,v_seq+1,$$seq)
SEQ_NO (output port) = v_seq

In this way, the Sequence transformation can be avoided but we will have the same facility in partition scenario as we are changing the port values only.

Though I believe it will work but please let me know if it is not.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain transaction control transformation in informatica

909


Explain how many types of dimensions are available in informatica?

681


Why sorter is an active transformation?

840


explain any diffcult scenario that u have faced in your experience... or explain any complex maping u have developed?

1793


can anyone suggest best free Talend data integration training online

1348






What is transformation?

765


What is the use of code page?

691


State the limitations where we cannot use joiner in the mapping pipeline?

636


What are the uses of etl tools?

753


What are the static cache and dynamic cache in informatica?

843


can u any challenge your project?

1696


how we can load rejected record's at run time?(not through bad files)

2011


How do you set a varible in incremental aggregation

1537


What is informatica etl tool?

644


Define mapping and session?

676