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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tWriteJSONfield change execution order of the job

Hello

 

I found following strange behaviour of the tWriteJSONfield component. It change the order of the rows processing.

 

There is an XML file with 2 records, i.e. <fileName>aaa.pdf</fileName><fileName>bbb.jpg</fileName>. Without tWriteJSONfield, 2 rows are processed by all components consequentially:

 

0683p000009LsCI.png

 

 

But when I add  tWriteJSONfield, both rows are processed first by components located before  tWriteJSONfield, and then both rows are processed by the rest of components:

 

0683p000009LsLY.png

 

It is criticall in my case because I use global variables for each row. Why it behave such way? Is it as designed?


0683p000009LsJO.png

Labels (5)
7 Replies
Anonymous
Not applicable
Author

Hello,

This should be the known component behaviour. such as, tAggregate and tDenormalize components may change input order.

What does your current use case look like?

Best regards

Sabrina

Anonymous
Not applicable
Author

Hi Sabrina

 

First of all it is generally not a good thing when execution order is not transparent.

I faced this issue because I use global variable which I set for the row. I set global variable before tWriteJSONField component. And I need to get this variable after  tWriteJSONField component. And because of this behaviour, I can get value only for the last row.

Anonymous
Not applicable
Author

Hello,

Would you mind posting your current setting of global variable screenshot on forum so that we can see if there is any workaround for your scenario?

Best regards

Sabrina

Anonymous
Not applicable
Author

Here it is:

 

1) generates 2 random rows

2) set random value to global variable

3) call tWriteJSON (doesnt really matter what it do)

4) get global variable value using tMap. The value is always same, the last one generated

 

0683p000009Ls4c.jpg

 

tLogRow_5 displays only value for the last row

 

0683p000009LrzP.jpg

 

0683p000009LsNF.jpg

 

 

 

 

Anonymous
Not applicable
Author

Hi Sabrina, any news on that? I found a workaround (using Java code) but I think this is an issue in Talend and should be fixed

Anonymous
Not applicable
Author

Hello,

So far, we don't have a better workaround on execution order issue. Feel free to create a jira issue on talend bug tracker.

https://jira.talendforge.org/secure/Dashboard.jspa

Best regards

Sabrina

 

Anonymous
Not applicable
Author

Hello
It seems like a bug, I tested and got the same issue.
Do you want to generate a json string for all input rows or a json string for each input row? If later, you can use tFlowToiterate to iterate each input row, eg:
tFileinputXML--main(row1)--tFlowToiterate--iterate-tfixedflowinput--main--tWriteJsonField--tMap-->tllogrow

on tFixedFlowInput or tMap, you can get the current value with the expression like:
(String)globalMap.get("row1.columnName")
//for string type.

Regards
Shong