Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Aznrhmn_97
Contributor
Contributor

tJavaRow returns ArrayIndexOutOfBoundsException after 10 rows

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
0683p000009MaHM.png

Labels (4)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

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

View solution in original post

2 Replies
vapukov
Master II
Master II

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

Aznrhmn_97
Contributor
Contributor
Author

It works. Thank you for your explanation