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

Problem with tWriteJSONField: Group By shifted in result set?

Hello,

i have a problem with the tWriteJSONField-component.
The current job (simplified) looks like this:
tMysqlInput => (tSortRow) => tWriteJSONField => tLogRow

The DB-Input-Data looks like:

|id     |typ|client_id|dayofweek|from_m|to_m|from_a|to_a|singleday|singlemonth|comment|odd_week|
|=------+---+---------+---------+------+----+------+----+---------+-----------+-------+-------=|
|1640760|a  |24       |0        |0000  |0000|0000  |0000|0        |0          |       |false   |
|1640761|a  |24       |1        |0800  |0000|0000  |1830|0        |0          |       |false   |
|1640766|a  |24       |6        |0830  |1300|0000  |0000|0        |0          |       |false   |
|1640767|a  |32       |0        |0     |0   |0     |0   |0        |0          |       |false   |
|1640768|a  |32       |1        |0830  |1830|0     |0   |0        |0          |       |false   |
...


These are opening times for clients. My goal is it to build a single json for all opening times per client. Expected Output is:

|client_id|openings
|24       |{"openings":}|
|32       |{"openings":}      |


Instead, what i actually get is:
|client_id|openings
|32       |{"openings":}|
|64       |{"openings":}      |


As you see the client_id does not match the client_id in the openings-json. They are all shifted by one row: The client_id 32 gets the openings from the client 24, client 64 gets the openings from client 32 and so on.

I tried to sort the data with a tSortRow before the tWriteJsonField but it stays the same.
I attached images from the job and the configuration of tWriteJSONField.

Can anyone help me?
Thank you

0683p000009MBTf.png 0683p000009MBTk.png
Labels (3)
4 Replies
Anonymous
Not applicable
Author

Hi,
What's the actual result when you design your job as:tMysqlInput  => tWriteJSONField => tLogRow?
The "group by" field on component tWriteJsonField should work well.
What's the build version you are using?
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi,
it looks the same. I made a screenshot to show the Job:

As you can see the "client_id" doesn't match the "client_id" in "openings". Only the last one is correct, but the client 62 is then duplicated.
I've used this component before in other Jobs and also never had this problem.

Build-Version: Talend Open Studio ESB 6.1.1.20151214_1327
0683p000009MBSs.png
Anonymous
Not applicable
Author

I am actually seeing the exact same behavior that is being described here.
I am on Talend Big Data build: 20160615_1327_patch

Is there any solution to this as this essentially renders the tWriteJsonField component useless.
Anonymous
Not applicable
Author

BUMP!!
Has anyone found a solution for this?
I am having exactly the same issue! 
Thanks,
pp84