Altering a data stream with Select values
While processing data there will come a need to alter field names, their data types or formats, and even removing fields altogether. The Select values step allows for all three functions and this recipe will show how to use it. The code for this recipe is available from the book's website.
How to do it...
Create a new transformation. Add a Generate Rows step and a Generate random value step to the canvas.
Create a hop between the two steps.
Open the Generate Rows step. Create a field named
row_test
of typeString
and with a default value oftest
. Click on OK to close the step.Open the Generate random value step. Create two fields, one a random string (named
random_num
) and the other a random string (namedrandom_string
). Click on OK to close the step.Bring over three Select values steps onto the canvas. Create hops from the Generate random value step to each of the Select values steps. When prompted to specify how to handle the stream of data, select...