Book Image

Pentaho 3.2 Data Integration: Beginner's Guide

Book Image

Pentaho 3.2 Data Integration: Beginner's Guide

Overview of this book

Pentaho Data Integration (a.k.a. Kettle) is a full-featured open source ETL (Extract, Transform, and Load) solution. Although PDI is a feature-rich tool, effectively capturing, manipulating, cleansing, transferring, and loading data can get complicated.This book is full of practical examples that will help you to take advantage of Pentaho Data Integration's graphical, drag-and-drop design environment. You will quickly get started with Pentaho Data Integration by following the step-by-step guidance in this book. The useful tips in this book will encourage you to exploit powerful features of Pentaho Data Integration and perform ETL operations with ease.Starting with the installation of the PDI software, this book will teach you all the key PDI concepts. Each chapter introduces new features, allowing you to gradually get involved with the tool. First, you will learn to work with plain files, and to do all kinds of data manipulation. Then, the book gives you a primer on databases and teaches you how to work with databases inside PDI. Not only that, you'll be given an introduction to data warehouse concepts and you will learn to load data in a data warehouse. After that, you will learn to implement simple and complex processes.Once you've learned all the basics, you will build a simple datamart that will serve to reinforce all the concepts learned through the book.
Table of Contents (27 chapters)
Pentaho 3.2 Data Integration Beginner's Guide
Credits
Foreword
The Kettle Project
About the Author
About the Reviewers
Preface
Index

Time for action – calculating the top scores with a subtransformation


Let's modify the transformation that calculates the top scores to avoid unnecessary duplication of steps:

  1. Under the transformation folder, create a new folder named subtransformations.

  2. Create a new transformation and save it in that new folder with the name scores.ktr.

  3. Expand the Mapping category of steps. Select a Mapping input specification step and drag it to the work area.

  4. Double-click the step and fill it like this:

  5. Add a Sort rows step and use it to sort the score field in descending order.

  6. Add a JavaScript step and type the following code to filter the top 10 rows:

    trans_Status = CONTINUE_TRANSFORMATION;
    if (getProcessCount('r')>10) trans_Status = SKIP_TRANSFORMATION;
  7. Add an Add sequence step to add a sequence field named seq.

  8. Finally, add a Mapping output specification step. You will find it in the Mapping category of steps. Your transformation looks like this:

  9. Save the transformation.

  10. Open the transformation top_scores...