Page 1 of 1

Substring and trim funcations in modify

Posted: Tue May 18, 2010 9:12 am
by SwathiCh
Hi All,

I need to trim the input column first and then need to extract first 15 bytes of that column, I can do this in transformaer with simple derivation but i need to implement this in MODIFY stage.

I am giving the specification as below
COL2_ID=substring[1,15]((string_trim[" "](COL1_ID)))
It is throwing the error as

Error parsing modify adapter: Error in binding: Expected source field selector; got: "("
Expected destination field selector, got: ")"; input:


If I remove string_trim funcation and run the job (with substring only), it is running fine but I need to trim the column as well.

Even I tried as below
COL2_ID=substring[1,15](string_trim[" "](COL1-ID))
this also throwing error.

Can any one help please?

Posted: Tue May 18, 2010 10:07 am
by ray.wurlod
As a general rule the modify operator does not support nested functions.

You can use two modify operators, but need a copy operator between them (either explicitly or implicitly).

Posted: Tue May 18, 2010 10:41 am
by SwathiCh
Thanks Ray,

One more doubt, If i use two modify stages and one copy stage, it will create 3 processes on server. If i use transformer , it will create only one process on server though it takes much compilation time(I dont care compilation time).

So here in this case, is it better to use transformer than modify?

Posted: Tue May 18, 2010 11:46 pm
by ray.wurlod
Operator combination will mean that the three stages will execute in the same single process.