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
Highlighted
Fifteen Stars TRF
Fifteen 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
Fifteen Stars TRF
Fifteen 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

Fifteen Stars TRF
Fifteen 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.

Highlighted
Fifteen Stars TRF
Fifteen 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
Fifteen Stars TRF
Fifteen 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 .

Fifteen Stars TRF
Fifteen Stars

Re: t_map java.lang.ArrayIndexOutOfBoundsException

Thank's to mark your cas as solved.


TRF

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download