tContextLoad fails with Integer as null

Four Stars

tContextLoad fails with Integer as null

Hello,

as the Talend Studio performance decreases drastically with a lot of objects in one job, we are trying to outsource some logic to Subjobs.

Unfortunately there is an error while promoting the context variables back to the main job.

  • We promote all context variables to the subjob
  • We do stuff in the subjob
  • We want to promote the context variables back to the main job
    • Job fails if there is a Integer not assigned (null)
    • tContextLoad uses key/value mechanism using strings, which fails if "null" is assigned to an Integer

talend_tcontextload_1.jpgMainJobtalend_tcontextload_2.jpgMainJob Contexttalend_tcontextload_3.jpgSubjobtalend_tcontextload_4.jpgMainJob Run

Help would be appreciated.

Employee

Re: tContextLoad fails with Integer as null

Maybe you can use a value like -1 or 0 for that context variable which will mean to not use it.  You can add a tMap or tFilterRow before your tContextLoad and filter on the value null key/pair.  If you do not pass a value, then it is not overwritten.  However, the tContextLoad can be configured to ignore, warn or error on these conditions.  This way you do not need to deal with null integer values. 

 

Not a great solution, but I personally dislike null Integer values... If possible, which is not always the case, I try to give my numeric variable a value and do not allow nulls.

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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

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