Question

How to pass parameter from previous stages as input to a fragment parameter

  • 8 September 2022
  • 2 replies
  • 31 views

Hi i am trying to pass the value from a field from previous stage as input to the fragment parameter . Basically I have created a fragment with shell stage and i am using this fragment in a pipeline . I want to pass the file path which i have formed by using some expressions in expression evaluator and have assigned to a field called Filename. I want to pass value from this field (“Filename”) to the fragment parameter. Can anyone suggest how to pass this .


2 replies

Userlevel 3
Badge

@Subha , consider a fragment, to all intents and purposes, as just another stage; the SDC record will get passed along to it as is. Can’t you access directly the record’s field called Filename?

Userlevel 1
Badge

Fragment parameters are set before the pipeline starts running, and they can’t be changed dynamically. However, you could change your code inside the fragment to look at the Filename field in the record and take actions based on it. There is an example of doing this for the shell executor in the documentation: https://docs.streamsets.com/portal/platform-datacollector/latest/datacollector/UserGuide/Executors/Shell.html#concept_av4_pnm_z1b

Reply