Unable to get field value in UDJC
I have simple transformation with following steps:
1. Get row from result
2. Read csv file name received from above step
3. User Defined Java Class with just processRow accessing the fields from input row. Code snippet:
Object r = getRow();
r = createOutputRow(r, data.outputRowMeta.size()); // Get value from an input field
String Field4 = get(Fields.In, "Field4").getString(r);
logBasic("Received field4 from input stream:" + Field4);
4. Write the output from UDJC to another csv file
I'm uable to access Field4 in UDJC i.e. always very first field from the input stream gets printed instead of 4th field. However, step 4 works fine and output gets written into output file. Using PDI 4.3 preview.
Any pointers, what might be going wrong here?
It works fine if output from TextFileInput(file name hard coded) is directly sent to UDJC. However, it doesn't work when file name is received from previous step is used by TextFileInpout to read file contents and then output is passed to UDJC.
Last edited by rajpal; 06-20-2012 at 07:29 PM.