• Index
  •  » Talend Enterprise Data Integration » General questions
  •  » tMysqlOutput with Dynamic table name doesn't work

#1 2012-05-31 15:20:32

ffwrude
Member
Registered: 2010-07-06
Posts: 57

tMysqlOutput with Dynamic table name doesn't work

Hi, I don't know if it's the right forum because it does not display TIS in the title (the old Talend Enterprise i guess).

Anyway.

I have a Job that do :

tmysqlInput => "SHOW TABLE"
tFlowtoIterate
tMysqlInput => "SELECT * FROM "+row1.table+"" (i tried to put it in a tSetGlobalVar too. Same problem)
tmysqlOutput => with ""+row1.table+"" in the table input text.

All the Schema are with ONE column set to DYNAMIC (mysqlinput AND output)

And i got

Code:

[statistics] connected
Exception in component tMysqlOutput_1
java.lang.NullPointerException
    at informix_exapaq.stress_test_nas_0_1.stress_test_NAS.tMysqlInput_1Process(stress_test_NAS.java:1022)
    at informix_exapaq.stress_test_nas_0_1.stress_test_NAS.runJobInTOS(stress_test_NAS.java:1295)
    at informix_exapaq.stress_test_nas_0_1.stress_test_NAS.main(stress_test_NAS.java:1169)
[statistics] disconnected

What am i doing wrong ?



EDIT :

- I tried puttin a table name in the tMysqlOutput. Same error
- I tried putting a table name in the "SELECT *" tMysqlinput and keep the dynamic table name in the tMysqlOutput. It works.
- I tried putting the dynamic table name in the "SELECT *" tmysqlinput and put a tlog row at the place of the tmysqloutput. It works

Last edited by ffwrude (2012-05-31 15:23:09)


Talend user since 2010-07-01

Offline

#2 2012-06-01 05:55:35

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: tMysqlOutput with Dynamic table name doesn't work

Hi

Which version of TIS do you use?

I test it under TIS 5.0.1 and didn't get NPE exception.
Maybe I miss some detail.

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-06-01 09:42:18

ffwrude
Member
Registered: 2010-07-06
Posts: 57

Re: tMysqlOutput with Dynamic table name doesn't work

I'm on TIS 4.2.2 not TOS.

http://img254.imageshack.us/img254/563/talend.jpg

Last edited by ffwrude (2012-06-01 09:55:04)


Talend user since 2010-07-01

Offline

#4 2012-06-01 09:45:30

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: tMysqlOutput with Dynamic table name doesn't work

Hi

Yes. I know it's TIS.

But I can't confirm whether it is a bug. The info is limited.

Regards,
Pedro


Only Paranoid Survive.

Offline

#5 2012-06-01 09:57:48

ffwrude
Member
Registered: 2010-07-06
Posts: 57

Re: tMysqlOutput with Dynamic table name doesn't work

You said TOS so that's why i clarified.

tMysqlInput1

Code:

"
SHOW TABLES (Schema is set String named "table")
"

tSetGlobalVar_1

Code:

Key "globaltable" => row1.table

tMysqlInput_3

Code:

SELECT
    *
FROM
    "+((String)globalMap.get("globaltable"))+"

tMysqlOutput_1

Code:

Table is set to ""+((String)globalMap.get("globaltable"))+""

Talend user since 2010-07-01

Offline

#6 2012-06-01 10:01:00

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: tMysqlOutput with Dynamic table name doesn't work

Hi

Sorry. My fault. I should type TIS. smile

In fact, I have created a job as the following image.
I didn't get a NPE exception....

Regards,
Pedro


Uploaded Images


Only Paranoid Survive.

Offline

#7 2012-06-01 10:06:43

ffwrude
Member
Registered: 2010-07-06
Posts: 57

Re: tMysqlOutput with Dynamic table name doesn't work

Did you put DYNAMIC schema and have like 3tables with different structures ?

Like

Table1 id(int),id2(int)
Table2 var(varchar-255), tatayoyo(id 25),trululu(int 20)
Table3 troupoidou(Blob)

etc...


Talend user since 2010-07-01

Offline

#8 2012-06-01 10:08:41

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: tMysqlOutput with Dynamic table name doesn't work

Hi

Yes. I have used dynamic schema.
Maybe this is related to BLOB column.

I will test it again.

Regards,
Pedro


Only Paranoid Survive.

Offline

#9 2012-06-01 10:12:17

ffwrude
Member
Registered: 2010-07-06
Posts: 57

Re: tMysqlOutput with Dynamic table name doesn't work

Hum.. ok but if it work on your version. How can i make a workaround ? Because i don't want to run 150times the job with just the table name changing.


Talend user since 2010-07-01

Offline

#10 2012-06-01 10:33:39

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: tMysqlOutput with Dynamic table name doesn't work

Hi

I can't reproduce this issue, either.

The dynamic feature is dynamic feature. There isn't any workaround. Sorry.
Could you show us the screenshot of your job, the settings of component?

Regards,
Pedro


Only Paranoid Survive.

Offline

#11 2012-06-01 10:46:12

ffwrude
Member
Registered: 2010-07-06
Posts: 57

Re: tMysqlOutput with Dynamic table name doesn't work

Ok, before doing that i just tried something and it's odd.

When i put a tJava after the tMysqlInput3 and ask him to "system.print" row1.table and then tMysqlInput3.QUERY

The row

table1
null
table2
SELECT * FROM table2

And i just found that table1 is empty. Could it come from there ?

COuld it be that the Dynamic schema could not retrieve the table structure ?

Last edited by ffwrude (2012-06-01 10:50:50)


Talend user since 2010-07-01

Offline

#12 2012-06-01 10:51:02

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: tMysqlOutput with Dynamic table name doesn't work

Hi

Yes. That may be the root reason.

But I don't know what cause null query...

Regards,
Pedro


Only Paranoid Survive.

Offline

#13 2012-06-01 10:53:19

ffwrude
Member
Registered: 2010-07-06
Posts: 57

Re: tMysqlOutput with Dynamic table name doesn't work

Ok. So now. How can i tell him to not try to do it with empty tables ?


Talend user since 2010-07-01

Offline

#14 2012-06-01 11:17:22

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: tMysqlOutput with Dynamic table name doesn't work

Hi

Sorry. I can't point out what causes null query now.
Please send me an email and attach your job.

Regards,
Pedro


Only Paranoid Survive.

Offline

#15 2012-06-01 11:20:31

ffwrude
Member
Registered: 2010-07-06
Posts: 57

Re: tMysqlOutput with Dynamic table name doesn't work

I can't right now (cause it's running) i deleted the empty tables and it works fine with the original job. But i have 22Gb to copy. So... i'll send it later.


Talend user since 2010-07-01

Offline

  • Index
  •  » Talend Enterprise Data Integration » General questions
  •  » tMysqlOutput with Dynamic table name doesn't work

Board footer

Powered by FluxBB