Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Have you experience tJavaRow returns ArrayIndexOutOfBoundsException after 10 rows executed?
I want to normalize multi columns and use the tMap to generate the sequence and pass it to tJavaRow but after 10 rows, I got indexOutOfBoundsException error. I did check my array but all seems okay. Can someone help me?
Here is my job flow, tJavaFlex->onSubJob ok->tFixedFlowInput->tNormalize(here I only normalize first column)->tMap(here I set the sequence using Numeric.sequence)->tJavaRow
The logic in tJavarow is
String[] attribute = input_row.attributes.split(","); String[] key = input_row.key.split(","); String[] value = input_row.value.split(","); int index = input_row.sequence; output_row.productId = input_row.productId; output_row.attributes = attribute[index]; output_row.key = key[index]; output_row.value = value[index];
Here is the error
Hi
you need to check your array (string to split) size and sequence column
if array index bigger than number of elements - you will have error
also, array index starting from 0 and there you need to control as well - string with 10 elements will have indexes 0-9
cheers
Hi
you need to check your array (string to split) size and sequence column
if array index bigger than number of elements - you will have error
also, array index starting from 0 and there you need to control as well - string with 10 elements will have indexes 0-9
cheers
It works. Thank you for your explanation