- Pentaho Data Integration Beginner's Guide(Second Edition)
- María Carina Roldán
- 722字
- 2021-07-23 15:47:01
Time for action – assigning tasks by filtering priorities with the Filter rows step
Continuing with the JIRA subject, let's do a more realistic distribution of tasks among programmers. Let's assign the severe task to our most experienced programmer, and the other tasks to others.
Create a new transformation.
Read the JIRA file and filter the unassigned tasks, just as you did in the previous section.
- Add a Filter rows step. Create a hop from the previous Filter rows step toward this new filter. When asked for the kind of hop, select Main output of step.
- Add two Microsoft Excel Output steps.
- Create a hop from the last Filter row to one of the Microsoft Excel Output steps. As the type for the hop, select Result is TRUE.
- Create a hop from the last Filter row to the other Excel step. This time as the type for the hop, select Result is FALSE. The transformation looks as follows:
- Double-click on the Filter rows step to edit it.
Note
Note that the content of the textboxes Send "true" data to step and Send "false"data to step should be the names of the destination steps - the two Microsoft Excel Output steps.
- Enter the condition
Priority = [Critical] OR Priority = [Severe] OR Priority = [Blocker]
.Tip
Alternatively you can use a single condition:
Priority IN LIST Critical;Severe;Blocker
. - Configure the Microsoft Excel Output step located at the end of the green hop. As fields, select Priority and Summary, and as the name for the file type
b_bouchard.xls
(the name of the senior programmer). - Configure the other Microsoft Excel Output step to send the fields Priority and Summary to an Excel file named
new_features_to_develop.xls
. - Click on OK and save the transformation.
- Run the transformation, and verify that the two Excel files were created. The files should look like this:
What just happened?
You sent the list of PDI new features to two Excel files: one file with the blocker, severe, and critical issues, and the other file with the rest of the issues.
In the Filter rows step, you put a condition to evaluate if the priority of a task was blocker, severe, or critical. For every row coming to the filter, the condition was evaluated.
The rows that met the condition, that is, those that had one of those three priorities, followed the green hop. This hop linked the Filter rows step with the Microsoft Excel Output step that creates the b_bouchard.xls
file. If you take a look at the Filter rows configuration window, you can also see the name of that step in the Send 'true' data to step textbox.
The rows that did not meet the condition, that is, those with another priority, were sent toward the other Microsoft Excel Output step, following the red hop. This hop linked the Filter rows step with the Microsoft Excel Output step that creates the new_features_to_develop.xls
file. In this case, you can also see the name of the Microsoft Excel Output step in the Send 'false' data to step textbox.
PDI steps for splitting the stream based on conditions
When you have to make a decision, and upon that decision split the stream into two, you can use the Filter rows step as you did in this last exercise. In this case, the Filter rows step acts as a decision maker: it has a condition and two possible destinations. For every row coming to the filter, the step evaluates the condition. Then, if the result of the condition is true, it decides to send the row towards the step selected in the first drop-down list of the configuration window: Send 'true' data to step.
If the result of the condition is false, it sends the row towards the step selected in the second drop-down list of the configuration window: Send 'false' data to step.
Alternatively, you can use the Java Filter step. As said in the last chapter, the purpose of both steps—Filter rows and Java Filter—is the same; the main difference is the way in which you type or enter the conditions.
Sometimes you have to make nested decisions, for example:

When the conditions are as simple as testing whether a field is equal to a value, you have a simpler way for creating a transformation like the one shown previously.
- Mastering Mesos
- 輕松學C#
- 腦動力:C語言函數速查效率手冊
- Hadoop 2.x Administration Cookbook
- 數據運營之路:掘金數據化時代
- STM32G4入門與電機控制實戰:基于X-CUBE-MCSDK的無刷直流電機與永磁同步電機控制實現
- 大型數據庫管理系統技術、應用與實例分析:SQL Server 2005
- Blender Compositing and Post Processing
- Moodle Course Design Best Practices
- Windows游戲程序設計基礎
- 大數據驅動的設備健康預測及維護決策優化
- INSTANT Drools Starter
- 基于神經網絡的監督和半監督學習方法與遙感圖像智能解譯
- 基于企業網站的顧客感知服務質量評價理論模型與實證研究
- Learning Linux Shell Scripting