Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to format a column based on a shrinking window array and coming up with multiple combinations.
I have created the java code for it but I am unable to use it in tjavarow. To simplify here is the example.
the trial_id is '123456' and the condition is "ABCDED :: XYZ"
String r[] = input_row.conditions.split(" :: ");
for (int i=0; i<r.length;i++)
{
output_row.trial_id = input_nct_trial_id;
output_row.fragments=r[i];
}
The issue is I am only getting one row in output the first one 123456|ABCDED and not the second one 123456|XYZ
I am new to talend so not even sure if this is supported or not?
I believe what you should be looking at is the tNormalize component. This will at least replace the piece of Java code you are showing here.
If you have the two columns "trial_id" and "condition" as input, you would normalize the column "condition" and use the item separator "::". This will give you the two rows you are looking for (or even three or more if you have something like "ABCDED :: XYZ :: MNOP" in there). Set the "Trim resulting values" in this component as your input seems to have spaces. If you need a different name for your output column ("fragments"), you could use a tMap after the tNormalize component.
I believe what you should be looking at is the tNormalize component. This will at least replace the piece of Java code you are showing here.
If you have the two columns "trial_id" and "condition" as input, you would normalize the column "condition" and use the item separator "::". This will give you the two rows you are looking for (or even three or more if you have something like "ABCDED :: XYZ :: MNOP" in there). Set the "Trim resulting values" in this component as your input seems to have spaces. If you need a different name for your output column ("fragments"), you could use a tMap after the tNormalize component.
what i findout was that tjavarow and tjavaa only outputs one row out for one row in. i did the processing and outputed all results in one column and used tnormalize to split up the result.
My logic was doing far more than just a split, it was just a question to get the basic splitting of one row into multiple rows output. but it was not working.