5.4.1 tContextLoad, the button "Sync columns" disable?

One Star

5.4.1 tContextLoad, the button "Sync columns" disable?

Hi Dears,
Just I found my Talend Open Studio version 5.4.1, the button "Sync columns" of component tContextLoad is disabled (NonActive Gray color), how to enable it? Please help, thanks.
Best Regards,
Peter.
Moderator

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Hi,
It is normal that the button "Sync columns" of component tContextLoad is disabled. Please check component reference TalendHelpCenter:tContextLoad. The fixed schema of tContextload are "Key" and "Value".
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Thanks.
But if disabled, and the field "value"'s default data type is String, how to change it to other data type (if context data type is int ... etc.) ?
Attached 4 snapshots (1,2,3,4), as the shown 1&2&3, when run will get error 4, but at before (old version) We could click the button to change the "value" field of component tContextLoad data type to Integer (sync from the "Input"), and resolve this issue, but if button is disabled, how to do then? how to change the field "value" data type (default String)?
Please help, thanks.

Best Regards,
Peter.
One Star

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

It will attempt to convert it to the desired type, for example the following was generated when I put an Integer context field into a job and put a tContextLoad in it:
if(key_tContextLoad_1!=null && "new1".equals(key_tContextLoad_1))
{
context.new1=Integer.parseInt(value_tContextLoad_1);

}
Moderator

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Hi,
What's your whole job design? In tContextLoad, the schema must be made of two columns, including the parameter name and the parameter value to be loaded(key, value, string type). Do you have any specific requirement on it?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Hi Sabrina,
Yes, I agree that In tContextLoad should have two fields key (String), value (Default String), but We could define the context in job with other data type right? for example Integer. How to change the value (Default String)'s data type to Integer?
Also my question is that, if define one context in job, and data type is Integer, how to use the tContextLoad to put value into it?
Could ignore the warning message and get the value successfully?
Best regards
Peter.
Moderator

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Hi,
Would you mind elaborating your case with an example with input and expected output values so that I can make a demo job to see if there is an optimistic workaround for it.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Hi Sabrina,
Thanks.
Or my question is that, if I define one Context with data type Integer in job, I would like to use component tContextLoad to put one Integer value into this Context, how do I need to do?
Just like my previous snapshots shown in this topic, I define Context named V_VarTest which data type Integer, and in my sample Demo I use the tRowGenerator to get one Integer value, and use the tMap to map into field , and let V_VarTest as the 's value in the tMap, and row data flow to tContextLoad, to , to , but for one is the Integer (tMap), one is the String (tContextLoad), will get error message and failed when run it, should change the data type to Integer because my Context' data type is Integer, how to do it?
In old version (5.0.2), I could click the button to sync the 's data type from its input (tMap's output), and change it to Integer, but now disabled. how to change the 's data type to fit the Context's data type which user defines?
Hope your help, thanks.
Best Regards
Peter.
Moderator

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Hi,
So far, tContextLoad cannot be user define in latest version. You can use "Implicit tContextLoad " to define data type by yourself.(see my pics)
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Does version 5.4.1 have it?
Moderator

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Hi,
Does version 5.4.1 have it?

It does exist in 5.4.1. Go to job review option-->Extra-->Implicit tContextLoad.
See related document TalendHelpCenter:How to define options on the Job view.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Hi Sabrina,
Thanks.
I got it, but just only two options, one is that load values from flat file, one is that load values from database.
But for my this case, I would like to get the value from one data flow (the output of tMap ... etc), so how I could do it directly? The old version We could use the button "Sync columns" to change the "value" field data type directly, and why We abandon it in new version?
For my this case, in 5.4.1, I think the only way is that get the output from tMap and put results into one flat file, and then use the "Implicit tContextLoad" get the value from the flat file?

Best Regards
Peter.
Moderator

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Hi,
But for my this case, I would like to get the value from one data flow (the output of tMap ... etc), so how I could do it directly? The old version We could use the button "Sync columns" to change the "value" field data type directly, and why We abandon it in new version?
For my this case, in 5.4.1, I think the only way is that get the output from tMap and put results into one flat file, and then use the "Implicit tContextLoad" get the value from the flat file?

We have made some change on tContextLoad component. It's welcome to open a work around jira issue of DI project on Talend Bug Tracker for your requirement.
For your case, you have to get the output from tMap and put results into one flat file, and then use the "Implicit tContextLoad" get the value from the flat file.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Hi Sabrina,
Thanks.
I logged one issue about this in Jira, thank you very much.
https://jira.talendforge.org/browse/TDI-28963
Best Regards
Peter.
Moderator

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

Hi,
Thanks for posting the jira link here.
It welcome to make communication with our developer in Talend Bug Tracker.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: 5.4.1 tContextLoad, the button "Sync columns" disable?

you can also use the tconverttype component to convert your data flow into a string and vice versa. This is what I did. But I agree it's suboptimal for handling. It would be better for the value to read from incoming data stream instead of waiting for a string.