Difference between Global Variable and Context Variable in Talend

Difference between Global Variable and Context Variable in Talend

Contexts and globalMap

context and globalMap are global areas used to store data that can be used by all

components within a Talend job.

context variables are predefined prior to job execution in a context group, whereas

globalMap variables are created on the fly at any point within a job.

Context variables

Context variables are used by Talend to store parameter information, and can be used:

  • To pass information into a job from the command line and/or a parent job
  • To manage values of parameters between environments
  • To store values within a job or set of jobs

globalMap

globalMap is a very important construct within Talend, in that:

  • Almost every component will write information to globalMap once it completes execution (for example NB_LINE is the number of rows processed in a component).
  • Certain components, such as tFlowToIterate or tFileList, will store data in globalMap variables for use by downstream components.
  • Developers can read and write to globalMap to create global variables in an ad hoc fashion. The use of global variables can often be the best way to ensure code is simple and efficient.

No comments:

Post a Comment