t_map java.lang.ArrayIndexOutOfBoundsException

Four Stars

t_map java.lang.ArrayIndexOutOfBoundsException

Hi 

I 'm using three t_map to lookup  from three different  postgres tables and than insert into one postgres table .

But I'm getting the error below :

 

Exception in component tMap_3 (Load_DimSong)
java.lang.ArrayIndexOutOfBoundsException: 1
at decisionalproject.load_dimsong_0_1.Load_DimSong.tDBInput_3Process(Load_DimSong.java:3293)
at decisionalproject.load_dimsong_0_1.Load_DimSong.runJobInTOS(Load_DimSong.java:6365)
at decisionalproject.load_dimsong_0_1.Load_DimSong.main(Load_DimSong.java:6214) .

 

DB Version : v9.X

 

This is  my job Load_DimSong.

Load_DimSong_Job.PNG

 

 

Thank you .

 

 


Accepted Solutions
Forteen Stars TRF
Forteen Stars

Re: t_map java.lang.ArrayIndexOutOfBoundsException

Is lookup_release_dates_album.date_release allways populated?

I suggest you to transform the expression like this in case of:

 

lookup_release_dates_album.date_release != null ? lookup_release_dates_album.date_release.split("-")[1] : null

You may also refer to this link for a technic to avoid multiple calls to the String.split() method

https://community.talend.com/t5/Design-and-Development/extract-fullname-to-firstname-and-middlename-...

 

 


TRF

All Replies
Forteen Stars TRF
Forteen Stars

Re: t_map java.lang.ArrayIndexOutOfBoundsException

So, what in tMap_3 ?


TRF
Four Stars

Re: t_map java.lang.ArrayIndexOutOfBoundsException

this is what in tmap3 :

tmap3.PNG

Highlighted
Forteen Stars TRF
Forteen Stars

Re: t_map java.lang.ArrayIndexOutOfBoundsException

The expressions for local variables are not visible.

Do we have to guess them?


TRF
Four Stars

Re: t_map java.lang.ArrayIndexOutOfBoundsException

I'm sorry .

my date_release is in this format yyyy-mm-jj
and I want to extract month , year and month+year from this date .
here are my expressions  :
lookup_release_dates_album.date_release.split("-")[0] for  variable dateYear
lookup_release_dates_album.date_release.split("-")[1] for variable dateMonth
lookup_release_dates_album.date_release.split("-")[0] +lookup_release_dates_album.date_release.split("-")[1] for variable datemonthYear.

Forteen Stars TRF
Forteen Stars

Re: t_map java.lang.ArrayIndexOutOfBoundsException

Is lookup_release_dates_album.date_release allways populated?

I suggest you to transform the expression like this in case of:

 

lookup_release_dates_album.date_release != null ? lookup_release_dates_album.date_release.split("-")[1] : null

You may also refer to this link for a technic to avoid multiple calls to the String.split() method

https://community.talend.com/t5/Design-and-Development/extract-fullname-to-firstname-and-middlename-...

 

 


TRF
Forteen Stars TRF
Forteen Stars

Re: t_map java.lang.ArrayIndexOutOfBoundsException

Is lookup_release_dates_album.date_release allways populated?

I suggest you to transform the expression like this in case of:

 

lookup_release_dates_album.date_release != null ? lookup_release_dates_album.date_release.split("-")[1] : null

You may also refer to this link for a technic to avoid multiple calls to the String.split() method

https://community.talend.com/t5/Design-and-Development/extract-fullname-to-firstname-and-middlename-...

 


TRF
Four Stars

Re: t_map java.lang.ArrayIndexOutOfBoundsException

Thank you so much ! 

I also added a condition song.date_release.length()>4 when I want to extract the month  because sometimes the date comes with this format YYYY so my condition becomes :

(song.date_release!=null &&
song.date_release.length()>4 )?
song.date_release.split("-")[1]:null

Thank you again ! you helped me a lot .

I 'll try to change my splitted strings in the same way in  the link u provided me with .

Forteen Stars TRF
Forteen Stars

Re: t_map java.lang.ArrayIndexOutOfBoundsException

Thank's to mark your cas as solved.


TRF

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.