Context variable is working fine in 6.4 DI ,but not in 7.1 DI

Highlighted
Five Stars

Context variable is working fine in 6.4 DI ,but not in 7.1 DI

Hi

I am implementing the SCD on table ,so I am taking the max value of that column at the start of the job and storing it in the context variable (X),which i declared as int .Now that context variable i am assigning in the numeric sequence  as " Numeric.sequnce('s1',X,1) ".

picturemessage_kd3ha2un.fde.png

 

Though I get above warning in 7.1 DI I am able to load data into the table.The problem arises when I load multiple tables in the same job and use tdie component ,the job will stopped instead of loading the next table.

If i run the same job in talend 6.4 DI ,I am not getting any warning and able to load the data successfully.

Can anyone please help me how to avoid this warning in 7.1 DI.

 

Thanks & Regards,

Sreelekha.

Highlighted
Nine Stars

Re: Context variable is working fine in 6.4 DI ,but not in 7.1 DI

Hi Screelekha

How and when you assign value to the context variable?
I suggest you check if the operation of "assigning the value to the context variable" ended before you start using it
Regards
DGM
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Highlighted
Five Stars

Re: Context variable is working fine in 6.4 DI ,but not in 7.1 DI

Hi

I am taking the max value of the column at the start of the job and storing it in the context variable (X),which i declared as int .Now that context variable i am assigning in the numeric sequence as " Numeric.sequnce('s1',X,1) " while loading the same column in table.

 

The same job is working fine in talend 6.4 DI ,but when comes to 7.1 DI ,it is throwing below warning.

"Null value will be used for context parameter  X: For input string: "context.X"

 

Thanks & Regards.

Sreelekha

 

Highlighted
Nine Stars

Re: Context variable is working fine in 6.4 DI ,but not in 7.1 DI

Can you add screenshots?
Regards
DGM
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Highlighted
Five Stars

Re: Context variable is working fine in 6.4 DI ,but not in 7.1 DI

Hi 

 

Please find attached screenshots of the same job which is getting warning in talend 7.1 DI and not getting warning in talend 6.4 DI .

Highlighted
Nine Stars

Re: Context variable is working fine in 6.4 DI ,but not in 7.1 DI

did you initialize the context variable in both cases?

you are assigning a value to the context variable in tmap
where are you using the context variable after assigning?
Regards
DGM
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Highlighted
Five Stars

Re: Context variable is working fine in 6.4 DI ,but not in 7.1 DI

Hi 

I am taking SOURCE_ID from STG_SOURCE  table and assigning this SOURCE_ID to context variable (context.SOURCE_ID) .

I am using this context.SOURCE_ID to load one column in output table. Data is loading properly ,but  I am getting this warning "Null value will be used for context parameter SOURCE_ID: For input string: "context.SOURCE_ID"

 

PFA screenshots.

 

Thanks & Regards,

Sreelekha.

Highlighted
Nine Stars

Re: Context variable is working fine in 6.4 DI ,but not in 7.1 DI

Are you doing all that in the same job?

A context variable can only can only be used within the same job
Regards
DGM
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Highlighted
Five Stars

Re: Context variable is working fine in 6.4 DI ,but not in 7.1 DI

Hi 

Yeah ,I am doing that in same job.

 

Thanks & Regards,

Sreelekha

Highlighted
Two Stars

Re: Context variable is working fine in 6.4 DI ,but not in 7.1 DI

I'm facing the same problem after moving from Talend 7.0.1 to Talend 7.1.1 with BigDecimal parameters in context definitions.

 

As far as I've been able to see, the problem comes from the default value in the context itself. Previously, if a BigDecimal parameter had no value attached in its context definition, it translated as a null value (a correct value for BigDecimal). Now, any value put as default for the context parameter is taken as a String value, so no value is translated to empty String (""), which is not a valid BigDecimal value.

 

As it says in the warning, the job itself changes the empty string for a null value, so it works. However, it prints the "error" in every iteration, so it's really annoying. I'm still trying to see if I can deactivate this alert somehow (if I'm not able to make the context BigDecimal parameter understand the empty value as null instead of "").

Highlighted
Two Stars

Re: Context variable is working fine in 6.4 DI ,but not in 7.1 DI

I've just fixed it thanks to the next workaround.

 

I've had to edit the file ParserUtils.java (<TalentFolder>\plugins\org.talend.librariesmanager_7.1.1.20181026_1147\resources\java\routines\system)

 

So it changed from this:

TalendParserUtils01.png

 

To this:

TalendParserUtils02.png

 

And that made the trick.

 

(However, I think the problem came from how the context deals with empty values)

 

 

 

 

 

 

Highlighted
Six Stars

Re: Context variable is working fine in 6.4 DI ,but not in 7.1 DI

Hi,

 

Any suggestion from our Talend expert? A patch maybe?

We have the same problem as JoanBenz, but with Integer, not BigDecimal.

 

Thanks

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog