Time for action—giving priority to Bouchard by using Append Stream

Suppose you want the Bouchard's row before the other rows. You can modify the transformation as follows:

  1. From the Flow category of steps, drag an Append Streams step to the canvas. Rearrange the steps and hops so the transformation looks like this:
    Time for action—giving priority to Bouchard by using Append Stream
  2. Edit the Append streams step and select as the Head hop the one belonging to the Bouchard's rows, and as the Tail hop the other. Doing this, you indicate toPDI how it has to order the streams.
  3. Do a preview on the Add sequence step. You should see this:
    Time for action—giving priority to Bouchard by using Append Stream

What just happened?

You changed the transformation to give priority to Bouchard's issues.

You made it by using the Append Streams step. By telling that the head hop was the one coming from the Bouchard's file, you got the expected order—first the rows with the tasks assigned to Bouchard, sorted by progress descending, and then the rows with the tasks assigned to other programmers, also sorted by progress descending.

Note

Whether you use arbitrary steps or some of the special steps mentioned here to merge streams, don't forget to verify the layouts of the streams you are merging. Pay attention to the warnings of the trap detector and avoid mixing row layouts.

Have a go hero—sorting and merging all tasks

Modify the previous exercise so that the final output is sorted by priority. Try two possible solutions:

  • Sort the input streams on their own and then use a Sorted Merge step.
  • Merge the stream with a Dummy step and then sort.

Which one do you think would give the best performance?

Tip

Refer to the Sort rows step issues in Chapter 3.

In which circumstances would you use the other option?

Have a go hero—trying to find missing countries

As you saw in the countries exercises, there are missing countries in the countries.xml file. In fact, the countries are there, but with different names. For example, Russia in the contestant file is Russian Federation in the XML file. Modify the transformation that looks for the language. Split the stream in two—one for the rows where a language was found and the other for the rows where no language was found. For this last stream, use a Value Mapper step to rename the countries you identified as wrong, that is, rename Russia as Russian Federation. Then look again for a language now with the new name. Finally, merge the two streams and create the output file with the result.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.101.91