36
Using Hadoop With Pentaho Data Integration

Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

  • Upload
    buithuy

  • View
    248

  • Download
    4

Embed Size (px)

Citation preview

Page 1: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Using Hadoop With Pentaho Data Integration

Page 2: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

This document is copyright © 2011 Pentaho Corporation. No part may be reprinted without written permission fromPentaho Corporation. All trademarks are the property of their respective owners.

Help and Support ResourcesIf you have questions that are not covered in this guide, or if you would like to report errors in the documentation,please contact your Pentaho technical support representative.

Support-related questions should be submitted through the Pentaho Customer Support Portal athttp://support.pentaho.com.

For information about how to purchase support or enable an additional named support contact, please contact yoursales representative, or send an email to [email protected].

For information about instructor-led training on the topics covered in this guide, visithttp://www.pentaho.com/training.

Limits of Liability and Disclaimer of WarrantyThe author(s) of this document have used their best efforts in preparing the content and the programs containedin it. These efforts include the development, research, and testing of the theories and programs to determine theireffectiveness. The author and publisher make no warranty of any kind, express or implied, with regard to theseprograms or the documentation contained in this book.

The author(s) and Pentaho shall not be liable in the event of incidental or consequential damages in connectionwith, or arising out of, the furnishing, performance, or use of the programs, associated instructions, and/or claims.

TrademarksPentaho (TM) and the Pentaho logo are registered trademarks of Pentaho Corporation. All other trademarks are theproperty of their respective owners. Trademarked names may appear throughout this document. Rather than listthe names and entities that own the trademarks or insert a trademark symbol with each mention of the trademarkedname, Pentaho states that it is using the names for editorial purposes only and to the benefit of the trademarkowner, with no intention of infringing upon that trademark.

Company InformationPentaho CorporationCitadel International, Suite 3405950 Hazeltine National DriveOrlando, FL 32822Phone: +1 407 812-OPEN (6736)Fax: +1 407 517-4575http://www.pentaho.com

E-mail: [email protected]

Sales Inquiries: [email protected]

Documentation Suggestions: [email protected]

Sign-up for our newsletter: http://community.pentaho.com/newsletter/

Page 3: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

| TOC | 3

Contents

Introduction................................................................................................................................4Installing PDI For Hadoop..........................................................................................................5

Installation Checklist: Hadoop...................................................................................................................... 5Obtaining the Installation Materials...............................................................................................................5Hadoop Node Installation Procedure............................................................................................................5Workstation Archive Package Deployment...................................................................................................6Apache Patch Deployment........................................................................................................................... 6Cleanup........................................................................................................................................................ 7

Hadoop Job Process Flow.........................................................................................................8Hadoop Transformation Process Flow.................................................................................... 11PDI Transformation Step Reference........................................................................................12

HBase Input................................................................................................................................................12HBase Output............................................................................................................................................. 14Hadoop File Input....................................................................................................................................... 16Hadoop File Output.....................................................................................................................................20Map/Reduce Input...................................................................................................................................... 22Map/Reduce Output....................................................................................................................................23S3 File Output.............................................................................................................................................23

PDI Job Entry Reference.........................................................................................................26Amazon EMR Job Executor........................................................................................................................26Hadoop Copy Files..................................................................................................................................... 27Hadoop Job Executor................................................................................................................................. 27Hadoop Transformation Job Executor........................................................................................................ 29Pig Script Executor..................................................................................................................................... 31

Hadoop to PDI Data Type Conversion.................................................................................... 33Hadoop Hive-Specific SQL Limitations....................................................................................34Adding a JDBC Driver..............................................................................................................35

Adding a JDBC Driver to Hadoop............................................................................................................... 36

Page 4: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

4 | Pentaho BI Suite Official Documentation | Introduction

Introduction

This document contains instructions for installing, configuring, and using the Hadoop functionality in Pentaho DataIntegration 4.2. This encompasses running PDI on a Hadoop node, executing Hadoop jobs via PDI, and accessing aHadoop cluster or Hive database as a data source.

Note: This is a tiny subset of the total Pentaho Data Integration document. It is designed to help evaluators,developers, and new customers who are only interested in PDI for its Hadoop functions. If you require moregeneral PDI documentation, consult the PDI 4.2 documentation set: Pentaho Data Integration User Guide,Pentaho Data Integration Administrator's Guide, and Installing Pentaho Data Integration. For a beginner'swalkthrough of PDI 4.2, refer instead to Getting Started With Pentaho Data Integration.

Pentaho supports the following Hadoop distributions:

• Apache Hadoop 0.20.2 and Hive 0.7.0• Cloudera CH3 Hadoop-0.20.2-cdh3u0 and hive-0.7.0-cdh3u0

Page 5: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | Installing PDI For Hadoop | 5

Installing PDI For Hadoop

Below are instructions for installing PDI on a Hadoop node and on user workstations. Installation and configuration ofthe Data Integration Server are not covered in this document; there is no special Hadoop functionality in the DI Server.

Installation Checklist: HadoopThe Installation Checklist is a concise list of instructions intended to show a high-level overview of the installationand configuration process. It also serves as a quick reference for administrators and developers who have performedseveral installations in the past and only need a brief rehash of the necessary steps. If you need more details than areprovided in this checklist, consult the appropriate section in the verbose instruction set that comprises the rest of thisguide.

Step Procedure DoneStep 1 Download the Pentaho Hadoop Distribution (PHD) archive package from the Enterprise

Edition FTP site.

Step 2 Stop the Hadoop service. Step 3 Navigate to your Hadoop root directory. Step 4 Unpack the Pentaho Hadoop Distribution archive package to the Hadoop root. Step 5 On your Hadoop nodes, install Enterprise Edition keys for Pentaho Data Integration and

Pentaho Hadoop.

Step 6 Start the Hadoop service. Step 7 Apache deployments must unpack the Hadoop patch archive to each Pentaho client tool

and server. (Cloudera deployments do not require this step).

Obtaining the Installation MaterialsConsult the Welcome Kit email that was sent to you after completing the sales process. This email contains usercredentials for the Enterprise Edition FTP site, where you can download individual archive packages for the DataIntegration for Hadoop package, and the desktop client tools needed to design Hadoop jobs and transformations. Hereare the packages you need for each platform and distribution:

• Data Integration for Hadoop: phd-ee-4.2.0-GA.tar.gz• Data Integration client tool Windows package: pdi-ee-client-4.2.0-GA.zip• Data Integration client tool Linux/Solaris/OS X package: pdi-ee-client-4.2.0-GA.tar.gz• Pentaho client tool patches for Apache Hadoop deployments: pentaho-apache-hadoop-4.2.0.zip

Note: You may wish to install the Data Integration Server as well. The DI Server installation and configurationprocess is covered in the Pentaho Data Integration Installation Guide.

Hadoop Node Installation ProcedureThese instructions assume that your Hadoop cluster is already properly configured and tested.

Note: You must be logged in as the user account that Hadoop is installed to. This user account must have ahome directory.

Follow the directions below to install Pentaho Data Integration on a Hadoop node.

Note: In the examples below, your Hadoop root directory is represented as /hadoop. Adjust this and any otherpaths to match your configuration.

1. Stop the Hadoop service.

~/hadoop/bin/stop-all.sh

2. Unpack the phd-ee-4.2.2-GA archive to the Hadoop root directory.

unzip phd-ee-4.2.0-GA.zip -d /hadoop

Page 6: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

6 | Pentaho BI Suite Official Documentation | Installing PDI For Hadoop

3. Navigate to the license-installer directory that was unpacked alongside the other files.

cd /hadoop/license-installer/

4. Run the install_license.sh script with the sole parameter of the location and name of your license file.

./install_license.sh install ~/downloads/Pentaho\ PDI\ Enterprise\ Edition.lic ~/downloads/Pentaho\ Hadoop\ Enterprise\ Edition.lic

5. Start the Hadoop services.

~/hadoop/bin/start-all.sh

The Pentaho Data Integration libraries are now installed on this Hadoop node, and will remotely execute Hadoop jobslaunched from a PDI workstation. Repeat this process for each node in the cluster.

Workstation Archive Package DeploymentFollow the below instructions to install the Data Integration client tools on your workstations.

Note: The example commands in this and other sections are specific to Linux. You will have to adjust or ignorethem on other operating systems.

1. Create a /pentaho/design-tools/ directory in an appropriate place in your hierarchy.

This directory should be accessible to all of the user accounts on this system that will run PDI.

Note: If you are using the graphical installer, it will create this directory structure for you, so you can skip thisstep.

mkdir -p /usr/local/pentaho/design-tools/

2. Unpack the pdi-ee-client-4.2.0-GA archive to /pentaho/design-tools/.

tar zxvf pdi-ee-client-4.2.0-GA.tar.gz -C /usr/local/pentaho/design-tools/

3. Navigate to the /pentaho/design-tools/license-installer/ directory.

4. Run the install_license.sh script with the sole parameter of the location and name of your license file.

./install_license.sh install /home/rwilco/downloads/Pentaho\ PDI\ Enterprise\ Edition.lic

The Data Integration client tools are now installed.

Apache Patch DeploymentThis procedure is only for Apache Hadoop deployments. Cloudera CDH3 deployments do not need to follow theseinstructions; doing so will make Pentaho client tools inoperable with CDH3.

Pentaho ships its client tools with default support for Cloudera CDH3 Hadoop deployments. In order to get Pentahoclient tools to work properly with other supported Hadoop distributions, you must remove some Cloudera-specific JARsand replace them with Apache-specific equivalents. Follow the instructions below to accomplish this.

Note: This procedure covers patch deployment for all Hadoop-aware Pentaho software. If you don't have or arenot using some of these programs, then skip those steps and follow only the ones that apply to you.

1. Exit any Pentaho client tools and stop the BI and DI servers if they are running.

2. Unpack the pentaho-apache-hadoop-4.2.0 zip file to a temporary location.

unzip pentaho-apache-hadoop-4.2.0.zip -d /home/pgibbons/temp/

This package contains a set of patch archives for each affected Pentaho program.

3. For PDI client tool deployments, delete the /pentaho/design-tools/data-integration/libext/pentaho/hadoop-core-0.20.2-cdh3u0.jar file, then unpack the pdi-client archive to the data-integrationdirectory.

rm /pentaho/design-tools/data-integration/libext/pentaho/hadoop-core-0.20.2-cdh3u0.jar && unzip /home/pgibbons/temp/pentaho-apache-hadoop-4.2.0/pdi-client.zip -d /pentaho/design-tools/data-integration/

Page 7: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | Installing PDI For Hadoop | 7

4. For DI Server deployments, delete the /pentaho/server/data-integration-server/tomcat/webapps/pentaho-di/WEB-INF/lib/hadoop-core-0.20.2-cdh3u0.jar file, then unpack the pdi-server archive tothe data-integration-server directory.

rm /pentaho/server/data-integration-server/tomcat/webapps/pentaho-di/WEB-INF/lib/hadoop-core-0.20.2-cdh3u0.jar && unzip /home/pgibbons/temp/pentaho-apache-hadoop-4.2.0/pdi-server.zip -d /pentaho/server/data-integration-server/

5. For Report Designer deployments, delete the /pentaho/design-tools/report-designer/lib/hadoop-core-0.20.2-cdh3u0.jar file, then unpack the prd archive to the report-designer directory.

rm /pentaho/design-tools/report-designer/lib/hadoop-core-0.20.2-cdh3u0.jar && unzip /home/pgibbons/temp/pentaho-apache-hadoop-4.2.0/prd.zip -d /pentaho/design-tools/report-designer/

6. For BI Server deployments, delete the /pentaho/server/biserver-ee/tomcat/webapps/pentaho-di/WEB-INF/lib/hadoop-core-0.20.2-cdh3u0.jar file, then unpack the bi-server archive to the biserver-eedirectory.

rm /pentaho/server/biserver-ee/tomcat/webapps/pentaho-di/WEB-INF/lib/hadoop-core-0.20.2-cdh3u0.jar && unzip /home/pgibbons/temp/pentaho-apache-hadoop-4.2.0/bi-server.zip -d /pentaho/server/biserver-ee/

7. For Metadata Editor deployments, delete the /pentaho/design-tools/metadata-editor/libext/JDBC/hadoop-core-0.20.2-cdh3u0.jar file, then unpack the pme archive to the metadata-editor directory.

rm /pentaho/design-tools/metadata-editor/libext/JDBC/hadoop-core-0.20.2-cdh3u0.jar && unzip /home/pgibbons/temp/pentaho-apache-hadoop-4.2.0/pme.zip -d /pentaho/design-tools/metadata-editor/

The Cloudera Hadoop JARs have now been replaces with Apache-specific versions.

CleanupYou can now delete the archive packages you downloaded.

Page 8: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

8 | Pentaho BI Suite Official Documentation | Hadoop Job Process Flow

Hadoop Job Process Flow

There are two paradigms for jobs in PDI: native PDI jobs, which are processes that typically include runningtransformations or other jobs; and Hadoop jobs, which are executed on the Hadoop node containing the data you areworking with. PDI has the ability to design and execute Hadoop jobs in a similar manner to native PDI jobs. The relevantstep is called Hadoop Job Executor:

This step requires a custom mapper/reducer Java class:

If you are using the Amazon Elastic MapReduce (EMR) service, you can use a similar Hadoop job step called AmazonEMR Job Executor. This differs from the standard Hadoop Job Executor in that it contains connection information forAmazon S3 and configuration options for EMR:

Page 9: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | Hadoop Job Process Flow | 9

You can also execute a PDI job that includes Hadoop-oriented transformations through the Hadoop TransformationJob Executor. In addition to ordinary transformation work, you can also use this step to design mapper/reducerfunctions within PDI, removing the need to provide a Java class. To do this, you must create transformations that act asa mapper and a reducer, then reference them properly in the step configuration:

The workflow for the transformation job executor looks something like this:

Page 10: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

10 | Pentaho BI Suite Official Documentation | Hadoop Job Process Flow

Page 11: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | Hadoop Transformation Process Flow | 11

Hadoop Transformation Process Flow

Pentaho Data Integration enables you to pull data from a Hadoop cluster, transform it in any of the usual ways, andpass it back to the cluster. You can also use specially-designed transformations as Hadoop mappers and reducers,which completely removes the need to create a Java class for these purposes. However, you must follow a specificworkflow in order to properly communicate with Hadoop, as shown in this sample transformation:

Hadoop will only communicate in terms of key/value pairs. Therefore, PDI must use a Map/Reduce Input step thatdefines the data type and name of the key and value:

...and a Map/Reduce Output step that passes the output back to Hadoop.

What happens in the middle is entirely up to the user.

Page 12: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

12 | Pentaho BI Suite Official Documentation | PDI Transformation Step Reference

PDI Transformation Step Reference

The transformation steps explained below pertain to Hadoop functions in Pentaho Data Integration.

HBase InputThis step reads data from an HBase table according to user-defined column metadata.

Configure Query

This tab contains connection details and basic query information. You can configure a connection in one of two ways:either via a comma-separated list of hostnames where the zookeeper quorum reside, or via an hbase-site.xml (and,optionally, hbase-default.xml) configuration file. If both zookeeper and HBase XML configuration options are supplied,then the zookeeper takes precedence.

Option DefinitionStep name The name of this step as it appears in

the transformation workspace.Zookeeper host(s) Comma-separated list of hostnames for

the zookeeper quorum.URL to hbase-site.xml Address of the hbase-site.xml file.URL to hbase-default.xml Address of the hbase-default.xml file.HBase table name The source HBase table to read from.

Click Get Mapped Table Names topopulate the drop-down list of possibletable names.

Mapping name A mapping to decode and interpretcolumn values. Click Get MappingsFor the Specified Table to populatethe drop-down list of availablemappings.

Start key value (inclusive) for tablescan

A starting key value to retrieve rowsfrom. This is inclusive of the valueentered.

Stop key value (exclusive) for tablescan

A stopping key value for the scan. Thisis exclusive of the value entered. Bothfields or the stop key field may be leftblank. If the stop key field is left blank,then all rows from (and including) thestart key will be returned.

Scanner row cache size The number of rows that should becached each time a fetch request ismade to HBase. Leaving this blankuses the default, which is to performno caching; one row would be returnedper fetch request. Setting a value in thisfield will increase performance (fasterscans) at the expense of memoryconsumption.

# The order of query limitation fields.Alias The name that the field will be given in

the output stream.Key Indicates whether the field is the table's

key field or not.Column family The column family in the HBase source

table that the field belongs to.

Page 13: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | PDI Transformation Step Reference | 13

Option DefinitionColumn name The name of the column in the HBase

table (family + column name uniquelyidentifies a column in the HBase table).

Type The PDI data type for the field.Format A formatting mask to apply to the field.Indexed values Indicates whether the field has a

predefined set of values that it canassume. You can output all or someof the fields defined in the mapping.You can create a subset of fields bydeleting rows. Clearing all rows fromthe table indicates that all fields definedin the mapping should be included inthe output.

Get Key/Fields Info Assuming the connection informationis complete and valid, this button willpopulate the field list and display thename of the key.

Create/Edit Mappings

This tab creates or edits a mapping for a given HBase table. A mapping simply defines metadata about the valuesthat are stored in the table. Since just about all information is stored as raw bytes in HBase, this allows PDI to decodevalues and execute meaningful comparisons for column-based result set filtering.

Option DefinitionHBase table name Displays a list of table names.

Connection information in the previoustab must be valid and complete in orderfor this drop-down list to populate.

Mapping name Names of any mappings that existfor the table. This box will be empty ifthere are no mappings defined for theselected table, in which case you canenter the name of a new mapping.

# The order of the mapping operation.Alias The name you want to assign to the

HBase table key. This is required forthe table key column, but optional fornon-key columns.

Key Indicates whether or not the field is thetable's key.

Column family The column family in the HBase sourcetable that the field belongs to. Non-keycolumns must specify a column familyand column name.

Column name The name of the column in the HBasetable.

Type Data type of the column. Key columnscan be of type: String Integer Unsignedinteger (positive only) Long Unsignedlong (positive only) Date Unsigneddate. Non-key columns can be oftype: String, Integer, Long, Float,Double, Boolean, Date, BigNumber,Serializable, Binary.

Indexed values String columns may optionally have aset of legal values defined for them by

Page 14: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

14 | Pentaho BI Suite Official Documentation | PDI Transformation Step Reference

Option Definitionentering comma-separated data intothis field.

Filter Result Set

This tab provides two fields that limit the range of key values returned by a table scan. Leaving both fields blank willresult in all rows being retrieved from the source table.

Option DefinitionMatch all / Match any When multiple column filters have been

defined, you have the option returningonly those rows that match all filters,or any single filter. Bounded rangeson a single numeric column can bedefined by defining two filters (upperand lower bounds) and selecting Matchall; similarly, open-ended ranges canbe defined by selecting Match any.

# The order of the filter operation.Alias A drop-down box of column alias

names from the mapping.Type Data type of the column. This is

automatically populated when youselect a field after choosing the alias.

Operator A drop-down box that contains eitherequality/inequality operators fornumeric, date, and boolean fields;or substring and regular expressionoperators for string fields.

Comparison value A comparison constant to use inconjunction with the operator.

Format A formatting mask to apply to the field.Signed comparison Specifies whether or not the

comparison constant and/or fieldvalues involve negative numbers (fornon-string fields only). If field valuesand comparison constants are onlypositive for a given filter, then HBase'snative lexicographical byte-basedcomparisons are sufficient. If this isnot the case, then it is necessaryfor column values to be deserializedfrom bytes to actual numbers beforeperforming the comparison.

Performance Considerations

Specifying fields in the Configure query tab will result in scans that return just those columns. Since HBase is a sparsecolumn-oriented database, this requires that HBase check to see whether each row contains a specific column. Morelookups equate to reduced speed, although the use of Bloom filters (if enabled on the table in question) mitigates thisto a certain extent. If, on the other hand, the fields table in the Configure query tab is left blank, it results in a scan thatreturns rows that contain all columns that exist in each row (not only those that have been defined in the mapping).However, the HBase Input step will only omit those columns that are defined in the mapping being used. Becauseall columns are returned, HBase does not have to do any lookups. However, if the table in question contains manycolumns and is dense, then this will result in more data being transferred over the network.

HBase OutputThis step writes data to an HBase table according to user-defined column metadata.

Page 15: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | PDI Transformation Step Reference | 15

Configure Connection

This tab contains HBase connection information. You can configure a connection in one of two ways: either via acomma-separated list of hostnames where the zookeeper quorum reside, or via an hbase-site.xml (and, optionally,hbase-default.xml) configuration file. If both zookeeper and HBase XML configuration options are supplied, then thezookeeper takes precedence.

Option DefinitionStep name The name of this step as it appears in

the transformation workspace.Zookeeper host(s) Comma-separated list of hostnames for

the zookeeper quorum.URL to hbase-site.xml Address of the hbase-site.xml file.URL to hbase-default.xml Address of the hbase-default.xml file.HBase table name The HBase table to write to. Click Get

Mapped Table Names to populate thedrop-down list of possible table names.

Mapping name A mapping to decode and interpretcolumn values. Click Get MappingsFor the Specified Table to populatethe drop-down list of availablemappings.

Disable write to WAL Disables writing to the Write AheadLog (WAL). The WAL is used as alifeline to restore the status quo if theserver goes down while data is beinginserted. Disabling WAL will increaseperformance.

Size of write buffer (bytes) The size of the write buffer used totransfer data to HBase. A larger bufferconsumes more memory (on both theclient and server), but results in fewerremote procedure calls. The default(in the hbase-default.xml) is 2MB(2097152 bytes), which is the value thatwill be used if the field is left blank.

Create/Edit Mappings

This tab creates or edits a mapping for a given HBase table. A mapping simply defines metadata about the valuesthat are stored in the table. Since just about all information is stored as raw bytes in HBase, this allows PDI to decodevalues and execute meaningful comparisons for column-based result set filtering.

Note: The names of fields entering the step are expected to match the aliases of fields defined in the mapping.All incoming fields must have a matching counterpart in the mapping. There may be fewer incoming fields thandefined in the mapping, but if there are more incoming fields then an error will occur. Furthermore, one of theincoming fields must match the key defined in the mapping.

Option DefinitionHBase table name Displays a list of table names.

Connection information in the previoustab must be valid and complete in orderfor this drop-down list to populate.

Mapping name Names of any mappings that existfor the table. This box will be empty ifthere are no mappings defined for theselected table, in which case you canenter the name of a new mapping.

# The order of the mapping operation.Alias The name you want to assign to the

HBase table key. This is required for

Page 16: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

16 | Pentaho BI Suite Official Documentation | PDI Transformation Step Reference

Option Definitionthe table key column, but optional fornon-key columns.

Key Indicates whether or not the field is thetable's key.

Column family The column family in the HBase sourcetable that the field belongs to. Non-keycolumns must specify a column familyand column name.

Column name The name of the column in the HBasetable.

Type Data type of the column. Key columnscan be of type: String Integer Unsignedinteger (positive only) Long Unsignedlong (positive only) Date Unsigneddate. Non-key columns can be oftype: String, Integer, Long, Float,Double, Boolean, Date, BigNumber,Serializable, Binary.

Indexed values String columns may optionally have aset of legal values defined for them byentering comma-separated data intothis field.

Get incoming fields Retrieves a field list using the givenHBase table and mapping names.

Performance Considerations

The Configure connection tab provides a field for setting the size of the write buffer used to transfer data to HBase. Alarger buffer consumes more memory (on both the client and server), but results in fewer remote procedure calls. Thedefault (defined in the hbase-default.xml file) is 2MB. When left blank, the buffer is 2MB, auto flush is enabled, and Putoperations are executed immediately. This means that each row will be transmitted to HBase as soon as it arrives at thestep. Entering a number (even if it is the same as the default) for the size of the write buffer will disable auto flush andwill result in incoming rows only being transferred once the buffer is full.

There is also a checkbox for disabling writing to the Write Ahead Log (WAL). The WAL is used as a lifeline to restorethe status quo if the server goes down while data is being inserted. However, the tradeoff for error-recovery is speed.

The Create/edit mappings tab has options for creating new tables. In the HBase table name field, you can suffix thename of the new table with parameters for specifying what kind of compression to use, and whether or not to use Bloomfilters to speed up lookups. The options for compression are: NONE, GZ and LZO; the options for Bloom filters are:NONE, ROW, ROWCOL. If nothing is selected (or only the name of the new table is defined), then the default of NONEis used for both compression and Bloom filters. For example, the following string entered in the HBase table name fieldspecifies that a new table called "NewTable" should be created with GZ compression and ROWCOL Bloom filters:

NewTable@GZ@ROWCOL

Note: Due to licensing constraints, HBase does not ship with LZO compression libraries; these must bemanually installed on each node if you want to use LZO compression.

Hadoop File InputThe Hadoop File Input step is used to read data from a variety of different text-file types stored on a Hadoop cluster.The most commonly used formats include Comma Separated Values (CSV files) generated by spreadsheets and fixedwidth flat files.

This step provides you with the ability to specify a list of files to read, or a list of directories with wild cards in the form ofregular expressions. In addition, you can accept file names from a previous step making file name handling more evenmore generic.

Below are tables that describe all available Hadoop File Input options.

Page 17: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | PDI Transformation Step Reference | 17

File Tab Options

Option DescriptionStep Name Optionally, you can change the name of this step to fit your

needs.

Note: Every step in a transformation must have aunique name.

File or Directory Specifies the location and/or name of the text file to readfrom. Click Browse to navigate to the file (select Hadoopin the file dialogue to enter in your Hadoop credentials),and click Add to add the file/directory/wildcard combinationto the list of selected files (grid) below.

Regular expression Specify the regular expression you want to use to selectthe files in the directory specified in the previous option.For example, you want to process all files that have a .txtoutput. (See below)

Selected Files This table contains a list of selected files (or wild cardselections) along with a property specifying if file isrequired or not. If a file is required and it isn't found, anerror is generated. Otherwise, the file name is skipped.

Show filenames(s)... Displays a list of all files that will be loaded based on thecurrent selected file definitions.

Show file content Displays the raw content of the selected file.Show content from first data line Displays the content from the first data line only for the

selected file.

Selecting file using Regular Expressions... The Text File Input step can search for files by wildcard in the form ofa regular expression. Regular expressions are more sophisticated than using '*' and '?' wildcards. Below are a fewexamples of regular expressions:

File Name Regular Expression Files selected/dirA/ .userdata.\.txt Find all files in /dirA/ with names

containing userdata and endingwith .txt

/dirB/ AAA.* Find all files in /dirB/ with names thatstart with AAA

/dirC/ [ENG:A-Z][ENG:0-9].* Find all files in /dirC/ with names thatstart with a capital and followed by adigit (A0-Z9)

Accepting file names from a previous step... This option allows even more flexibility in combination with other stepssuch as "Get File Names". You can create your file name and pass it to this step. This way the file name can come fromany source; a text file, database table, and so on.

Option DescriptionAccept file names from previous steps Enables the option to get file names from previous stepsStep to read file names from Step from which to read the file namesField in the input to use as file name Text File Input looks in this step to determine which

filenames to use

Content Tab

Options under the Content tab allow you to specify the format of the text files that are being read. Below is a list of theoptions associated with this tab:

Option DescriptionFile type Can be either CSV or Fixed length. Based on this

selection, Spoon will launch a different helper GUI whenyou click Get Fields in the Fields tab.

Separator One or more characters that separate the fields in a singleline of text. Typically this is ; or a tab.

Page 18: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

18 | Pentaho BI Suite Official Documentation | PDI Transformation Step Reference

Option DescriptionEnclosure Some fields can be enclosed by a pair of strings to allow

separator characters in fields. The enclosure string isoptional. If you use repeat an enclosures allow text line'Not the nine o''clock news.'. With ' the enclosure string,this gets parsed as Not the nine o'clock news.

Allow breaks in enclosed fields? Not implementedEscape Specify an escape character (or characters) if you have

these types of characters in your data. If you have \ as anescape character, the text 'Not the nine o\'clock news' (with' the enclosure) gets parsed as Not the nine o'clock news.

Header & number of header lines Enable if your text file has a header row (first lines in thefile); you can specify the number of times the header linesappears.

Footer & number of footer lines Enable if your text file has a footer row (last lines in thefile); you can specify the number of times the footer rowappears.

Wrapped lines and number of wraps Use if you deal with data lines that have wrapped beyond aspecific page limit; note that headers and footers are neverconsidered wrapped

Paged layout and page size and doc header Use these options as a last resort when dealing with textsmeant for printing on a line printer; use the number ofdocument header lines to skip introductory texts and thenumber of lines per page to position the data lines

Compression Enable if your text file is in a Zip or GZip archive. Note: Atthe moment, only the first file in the archive is read.

No empty rows Do not send empty rows to the next steps.Include file name in output Enable if you want the file name to be part of the outputFile name field name Name of the field that contains the file nameRownum in output? Enable if you want the row number to be part of the outputRow number field name Name of the field that contains the row numberFormat Can be either DOS, UNIX, or mixed. UNIX files have lines

that are terminated by line feeds. DOS files have linesseparated by carriage returns and line feeds. If you specifymixed, no verification is done.

Encoding Specify the text file encoding to use; leave blank to usethe default encoding on your system. To use Unicode,specify UTF-8 or UTF-16. On first use, Spoon searchesyour system for available encodings.

Be lenient when parsing dates? Disable if you want strict parsing of data fields; if case-lenient parsing is enabled, dates like Jan 32nd will becomeFeb 1st.

The date format Locale This locale is used to parse dates that have been writtenin full such as "February 2nd, 2006;" parsing this date on asystem running in the French (fr_FR) locale would not workbecause February is called Février in that locale.

Error Handling Tab

Options under the Error Handling tab allow you to specify how the step reacts when errors (such as, malformed records,bad enclosure strings, wrong number of fields, premature line ends), occur. The table below describes the optionsavailable for Error handling:

Option DescriptionIgnore errors? Enable if you want to ignore errors during parsingSkip error lines Enable if you want to skip those lines that contain errors. You can generate an extra file that

contains the line numbers on which the errors occurred. Lines with errors are not skipped, thefields that have parsing errors, will be empty (null)

Error count field name Add a field to the output stream rows; this field contains the number of errors on the line

Page 19: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | PDI Transformation Step Reference | 19

Option DescriptionError fields field name Add a field to the output stream rows; this field contains the field names on which an error

occurredError text field name Add a field to the output stream rows; this field contains the descriptions of the parsing errors

that have occurredWarnings file directory When warnings are generated, they are placed in this directory. The name of that file is

<warning dir>/filename.<date_time>.<warning extension>Error files directory When errors occur, they are placed in this directory. The name of the file is <errorfile_dir>/

filename.<date_time>.<errorfile_extension>Failing line numbersfiles directory

When a parsing error occurs on a line, the line number is placed in this directory. The nameof that file is <errorline dir>/filename.<date_time>.<errorline extension>

Filters Tab

Options under the Filters tab allow you to specify the lines you want to skip in the text file. The table below describes theavailable options for defining filters:

Option DescriptionFilter string The string for which to searchFilter position The position where the filter string has to be at in the line.

Zero (0) is the first position in the line. If you specify avalue below zero (0) here, the filter string is searched for inthe entire string.

Stop on filter Specify Y here if you want to stop processing the currenttext file when the filter string is encountered.

Fields Tab

The options under the Fields tab allow you to specify the information about the name and format of the fields being readfrom the text file. Available options include:

Option DescriptionName Name of the fieldType Type of the field can be either String, Date or NumberFormat See Number Formats below for a complete description of

format symbols.Length For Number: Total number of significant figures in a

number; For String: total length of string; For Date: lengthof printed output of the string (e.g. 4 only gives back theyear).

Precision For Number: Number of floating point digits; For String,Date, Boolean: unused;

Currency Used to interpret numbers like $10,000.00 or E5.000,00Decimal A decimal point can be a "." (10;000.00) or "," (5.000,00)Grouping A grouping can be a dot "," (10;000.00) or "." (5.000,00)Null if Treat this value as NULLDefault Default value in case the field in the text file was not

specified (empty)Trim Type trim this field (left, right, both) before processingRepeat If the corresponding value in this row is empty, repeat the

one from the last time it was not empty (Y/N)

Number formats... The information about Number formats was taken from the Sun Java API documentation, DecimalFormats.

Symbol Location Localized Meaning0 Number Yes Digit# Number Yes Digit, zero shows as absent. Number Yes Decimal separator or

monetary decimal separator- Number Yes Minus sign

Page 20: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

20 | Pentaho BI Suite Official Documentation | PDI Transformation Step Reference

Symbol Location Localized Meaning, Number Yes Grouping separatorE Number Yes Separates mantissa and

exponent in scientificnotation; need not be quotedin prefix or suffix

; Sub pattern boundary Yes Separates positive andnegative sub patterns

% Prefix or suffix Yes Multiply by 100 and show aspercentage

\u2030 Prefix or suffix Yes Multiply by 1000 and showas per mille

(\u00A4) Prefix or suffix No Currency sign, replaced bycurrency symbol. If doubled,replaced by internationalcurrency symbol. If presentin a pattern, the monetarydecimal separator is usedinstead of the decimalseparator.

' Prefix or suffix No Used to quote specialcharacters in a prefix orsuffix, for example, "'#'#"formats 123 to "#123". Tocreate a single quote itself,use two in a row: "# o''clock".

Scientific Notation... In a pattern, the exponent character immediately followed by one or more digit charactersindicates scientific notation (for example, "0.###E0" formats the number 1234 as "1.234E3".

Date formats... The information about Date formats was taken from the Sun Java API documentation, Date Formats.

Letter Date or Time Component Presentation ExamplesG Era designator Text ADy Year Year 1996; 96M Month in year Month July; Jul; 07w Week in year Number 27W Week in month Number 2D Day in year Number 189d Day in month Number 10F Day of week in month Number 2E Day in week Text Tuesday; Tuea Am/pm marker Text PMH Hour in day (0-23) Number 0 n/ak Hour in day (1-24) Number 24 n/aK Hour in am/pm (0-11) Number 0 n/ah Hour in am/pm (1-12) Number 12 n/am Minute in hour Number 30 n/as Second in minute Number 55 n/aS Millisecond Number 978 n/az Time zone General time zone Pacific Standard Time; PST;

GMT-08:00Z Time zone RFC 822 time zone -0800

Hadoop File OutputThe Hadoop File Output step is used to export data to text files stored on a Hadoop cluster. This is commonly usedto generate Comma Separated Values (CSV files) that can be read by spreadsheet applications. It is also possible togenerate fixed width files by setting lengths on the fields in the fields tab.

Page 21: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | PDI Transformation Step Reference | 21

Below are tables that describe all available Hadoop File Output options.

File Tab

The options under the File tab is where you define basic properties about the file being created, such as:

Option DescriptionStep name Optionally, you can change the name of this step to fit your

needs.

Note: Every step in a transformation must have aunique name.

Filename Specifies the location and/or name of the text file to writeto. Click Browse to navigate to the file (select Hadoop inthe file dialogue to enter in your Hadoop credentials) if youdon't know the path and filename.

Extension Adds a point and the extension to the end of the file name.(.txt)

Accept file name from field? Enable to specify the file name(s) in a field in the inputstream

File name field When the previous option is enabled, you can specify thefield that will contain the filename(s) at runtime.

Include stepnr in filename If you run the step in multiple copies (Launching severalcopies of a step), the copy number is included in the filename, before the extension. (_0).

Include partition nr in file name? Includes the data partition number in the file nameInclude date in file name Includes the system date in the filename (_20101231)Include time in file name Includes the system time in the filename (_235959)Show file name(s) Displays a list of the files that will be generated

Note: This is a simulation and depends on thenumber of rows that will go into each file.

Content tab

The content tab contains the following options for describing the content being read:

Option DescriptionAppend Enable to append lines to the end of the specified fileSeparator Specify the character that separates the fields in a single

line of text; typically this is semicolon (;) or a tabEnclosure A pair of strings can enclose some fields. This allows

separator characters in fields. The enclosure string isoptional. Enable if you want the text file to have a headerrow (first line in the file).

Force the enclosure around fields? Forces all field names to be enclosed with the characterspecified in the Enclosure property above

Header Enable this option if you want the text file to have a headerrow (first line in the file)

Footer Enable this option if you want the text file to have a footerrow (last line in the file)

Format Can be either DOS or UNIX; UNIX files have lines areseparated by line feeds, DOS files have lines separated bycarriage returns and line feeds

Encoding Specify the text file encoding to use. Leave blank to usethe default encoding on your system. To use Unicode,specify UTF-8 or UTF-16. On first use, Spoon searchesyour system for available encodings.

Compression Specify the type of compression, .zip or .gzip to use whencompressing the output.

Page 22: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

22 | Pentaho BI Suite Official Documentation | PDI Transformation Step Reference

Option DescriptionNote: Only one file is placed in a single archive.

Fast data dump (no formatting) Improves the performance when dumping large amountsof data to a text file by not including any formattinginformation

Split every ... rows If the number N is larger than zero, split the resulting text-file into multiple parts of N rows

Add Ending line of file Allows you to specify an alternate ending row to the outputfile

Fields tab

The fields tab is where you define properties for the fields being exported. The table below describes each of theoptions for configuring the field properties:

Option DescriptionName The name of the fieldType Type of the field can be either String, Date or Number.Format The format mask to convert with. See Number Formats for

a complete description of format symbols.Length The length option depends on the field type follows:

• Number - Total number of significant figures in anumber

• String - total length of string• Date - length of printed output of the string (for exampl,

4 returns year)Precision The precision option depends on the field type as follows:

• Number - Number of floating point digits• String - unused• Date - unused

Currency Symbol used to represent currencies like $10,000.00 orE5.000,00

Decimal A decimal point can be a "." (10,000.00) or "," (5.000,00)Group A grouping can be a "," (10,000.00) or "." (5.000,00)Trim type The trimming method to apply on the string

Note: Trimming works when there is no field lengthgiven only.

Null If the value of the field is null, insert this string into the textfile

Get Click to retrieve the list of fields from the input fieldsstream(s)

Minimal width Change the options in the Fields tab in such a way that theresulting width of lines in the text file is minimal. So insteadof save 0000001, you write 1, and so on. String fields willno longer be padded to their specified length.

Map/Reduce InputThis step defines the key/value pairs for Hadoop input. The output of this step is appropriate for whatever dataintegration transformation tasks you need to perform.

Option DefinitionStep name The name of this step as it appears in

the transformation workspace.

Page 23: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | PDI Transformation Step Reference | 23

Option DefinitionKey field The Hadoop input field and data type

that represents the key in map/reduceterms.

Value field The Hadoop input field and data typethat represents the value in map/reduce terms.

Map/Reduce OutputThis step defines the key/value pairs for Hadoop output. The output of this step will become the output to Hadoop,which changes depending on what the transformation is used for.

If this step is included in a transformation used a as a mapper and there is a combiner and/or reducer configured, theoutput will become the input pairs for the combiner and/or reducer. If there are no combiner or reducers configured, theoutput will end up written to HDFS in the output folder of the job for which it was run.

If this step is included in a transformation used as a combiner and there is a reducer configured, the output will becomethe input pairs for the reducer. If no reducer configured, the output will end up written to HDFS in the output folder of thejob for which it was run.

If this step is included in a transformation used as a reducer, then the output will be written to HDFS in the output folderof the job for which it was run.

Note: You are not able to define the data type for the key or value here; it is defined earlier in yourtransformation. However, a reducer or combiner that takes this output as its input will have to know what the keyand value data types are, so you may need to make note of them somehow.

Option DefinitionStep name The name of this step as it appears in

the transformation workspace.Key field The Hadoop output field that represents

the key in map/reduce terms.Value field The Hadoop output field that represents

the value in map/reduce terms.

S3 File OutputThis step exports data to a text file on an Amazon Simple Storage Service (S3) account.

File Tab

The File tab defines basic file properties for this step's output.

Option DescriptionStep name The name of this step in the

transformation workspace.Filename The name of the output text file.Accept file name from field? When checked, enables you to specify

file names in a field in the input stream.File name field When the Accept file name from field

option is checked, specify the field thatwill contain the filenames.

Extension The three-letter file extension toappend to the file name.

Include stepnr in filename If you run the step in multiple copies(launching several copies of a step),the copy number is included in the filename, before the extension. (_0).

Page 24: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

24 | Pentaho BI Suite Official Documentation | PDI Transformation Step Reference

Option DescriptionInclude partition nr in file name? Includes the data partition number in

the file name.Include date in file name Includes the system date in the

filename (_20101231).Include time in file name Includes the system time (24-hour

format) in the filename (_235959).Show file name(s) Displays a list of the files that will be

generated. This is a simulation anddepends on the number of rows thatwill go into each file.

Content tab

The content tab contains options for describing the file's content.

Option DescriptionAppend When checked, appends lines to the

end of the file.Separator Specifies the character that separates

the fields in a single line of text;typically this is semicolon or a tab.

Enclosure Optionally specifies the character thatdefines a block of text that is allowedto have separator characters withoutcausing separation. Typically a singleor double quote.

Force the enclosure around fields? Forces all field names to be enclosedwith the character specified in theEnclosure property above.

Header Enable this option if you want the textfile to have a header row (first line inthe file).

Footer Enable this option if you want the textfile to have a footer row (last line in thefile).

Format Specifies either DOS or UNIX fileformats. UNIX files have lines that areseparated by line feeds, DOS files havelines that are separated by carriagereturns and line feeds.

Compression Specifies the type of compression touse on the output file -- either zip orgzip. Only one file is placed in a singlearchive.

Encoding Specifies the text file encoding touse. Leave blank to use the defaultencoding on your system. To useUnicode, specify UTF-8 or UTF-16. Onfirst use, Spoon searches your systemfor available encodings.

Fast data dump (no formatting) Improves the performance whendumping large amounts of data to atext file by not including any formattinginformation.

Right pad fields When checked, fields will be right-padded to their defined width.

Split every ... rows If the number N is larger than zero,splits the resulting text file into multipleparts of N rows.

Page 25: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | PDI Transformation Step Reference | 25

Option DescriptionAdd Ending line of file Enables you to specify an alternate

ending row to the output file.

Fields tab

The Fields tab defines properties for the exported fields.

Option DescriptionName The name of the field.Type The field's data type; String, Date or

Number.Format The format mask (number type).Length The length option depends on the

field type. Number: total numberof significant figures in a number;String: total length of a string; Date:determines how much of the date stringis printed or recorded.

Precision The precision option depends onthe field type, but only Number issupported; it returns the number offloating point digits.

Currency Symbol used to represent currencies.Decimal A decimal point; this is either a dot or a

comma.Group A method of separating units of

thousands in numbers of four digits orlarger. This is either a dot or a comma.

Trim type Truncates the field (left, right, both)before processing. Useful for fields thathave no static length.

Null Inserts the specified string into the textfile if the field value is null.

Get Retrieves a list of fields from the inputstream.

Minimal width Minimizes field width by removingunnecessary characters (such assuperfluous zeros and spaces). If set,string fields will no longer be padded totheir specified length.

Page 26: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

26 | Pentaho BI Suite Official Documentation | PDI Job Entry Reference

PDI Job Entry Reference

The job steps explained below pertain to Hadoop functions in Pentaho Data Integration. Some of them are Hadoop-specific, and others are standard PDI steps that are required for some kinds of Hadoop jobs.

Amazon EMR Job ExecutorThis job entry executes Hadoop jobs on an Amazon Elastic MapReduce (EMR) account. In order to use this step, youmust have an Amazon Web Services (AWS) account configured for EMR, and a premade Java JAR to control theremote job.

Option DefinitionName The name of this Amazon EMR Job

Executer step instance.EMR Job Flow Name The name of the Amazon EMR job flow

(series of steps) you are executing.AWS Access Key Your Amazon Web Services access

key.AWS Secret Key Your Amazon Web Services secret key.S3 Staging Directory The Amazon Simple Storage Service

(S3) address of the working directoryfor this Hadoop job. This directory willcontain the MapReduce JAR, and logfiles will be placed here as they arecreated.

MapReduce JAR The Java JAR that contains yourHadoop mapper and reducer classes.The job must be configured andsubmitted using a static main method inany class in the JAR.

Command line arguments Any command line arguments that mustbe passed to the static main method inthe specified JAR.

Number of Instances The number of Amazon ElasticCompute Cloud (EC2) instances youwant to assign to this job.

Master Instance Type The Amazon EC2 instance type thatwill act as the Hadoop "master" in thecluster, which handles map/reduce taskdistribution.

Slave Instance Type The Amazon EC2 instance type thatwill act as one or more Hadoop "slaves"in the cluster. Slaves are assignedtasks from the master. This is only validif the number of instances is greaterthan 1.

Enable Blocking Forces the job to wait until each stepcompletes before continuing to the nextstep. This is the only way for PDI to beaware of a Hadoop job's status. If leftunchecked, the Hadoop job is blindlyexecuted, and PDI moves on to thenext step. Error handling/routing will notwork unless this option is checked.

Logging Interval Number of seconds between logmessages.

Page 27: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | PDI Job Entry Reference | 27

Hadoop Copy FilesThis job entry copies files in a Hadoop cluster from one location to another.

General

Option DefinitionInclude Subfolders If selected, all subdirectories within the

chosen directory will be copied as wellDestination is a file Determines whether the destination is a

file or a directoryCopy empty folders If selected, will copy all directories,

even if they are empty the IncludeSubfolders option must be selected forthis option to be valid

Create destination folder If selected, will create the specifieddestination directory if it does notcurrently exist

Replace existing files If selected, duplicate files in thedestination directory will be overwritten

Remove source files If selected, removes the source filesafter copy (a move procedure)

Copy previous results to args If selected, will use previousstep results as your sources anddestinations

File/folder source The file or directory to copy from; clickBrowse and select Hadoop to enteryour Hadoop cluster connection details

File/folder destination The file or directory to copy to; clickBrowse and select Hadoop to enteryour Hadoop cluster connection details

Wildcard (RegExp) Defines the files that are copied inregular expression terms (instead ofstatic file names), for instance: .*\.txtwould be any file with a .txt extension

Files/folders A list of selected sources anddestinations

Result files name

Option DefinitionAdd files to result files name Any files that are copied will appear as

a result from this step; shows a list offiles that were copied in this step

Hadoop Job ExecutorThis job entry executes Hadoop jobs on a Hadoop node. There are two option modes: Simple (the default condition), inwhich you only pass a premade Java JAR to control the job; and Advanced, in which you are able to specify static mainmethod parameters. Most of the options explained below are only available in Advanced mode. The User Defined tabin Advanced mode is for Hadoop option name/value pairs that are not defined in the Job Setup and Cluster tabs.

General

Option DefinitionName The name of this Hadoop Job Executer

step instance.

Page 28: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

28 | Pentaho BI Suite Official Documentation | PDI Job Entry Reference

Option DefinitionHadoop Job Name The name of the Hadoop job you are

executing.Jar The Java JAR that contains your

Hadoop mapper and reducer jobinstructions in a static main method.

Command line arguments Any command line arguments that mustbe passed to the static main method inthe specified JAR.

Job Setup

Option DefinitionOutput Key Class The Apache Hadoop class name that

represents the output key's data type.Output Value Class The Apache Hadoop class name that

represents the output value's data type.Mapper Class The Java class that will perform the

map operation. Pentaho's defaultmapper class should be sufficient formost needs. Only change this value ifyou are supplying your own Java classto handle mapping.

Combiner Class The Java class that will perform thecombine operation. Pentaho's defaultcombiner class should be sufficient formost needs. Only change this value ifyou are supplying your own Java classto handle combining.

Reducer Class The Java class that will perform thereduce operation. Pentaho's defaultreducer class should be sufficient formost needs. Only change this valueif you are supplying your own Javaclass to handle reducing. If you donot define a reducer class, then noreduce operation will be performed andthe mapper or combiner output will bereturned.

Input Path The path to your input file on theHadoop cluster.

Output Path The path to your output file on theHadoop cluster.

Input Format The Apache Hadoop class name thatrepresents the input file's data type.

Output Format The Apache Hadoop class name thatrepresents the output file's data type.

Cluster

Option DefinitionWorking Directory The temporary job work directory on

your Hadoop cluster.HDFS Hostname Hostname for your Hadoop cluster.HDFS Port Port number for your Hadoop cluster.Job Tracker Hostname If you have a separate job tracker node,

type in the hostname here. Otherwiseuse the HDFS hostname.

Page 29: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | PDI Job Entry Reference | 29

Option DefinitionJob Tracker Port Job tracker port number; this cannot be

the same as the HDFS port number.Number of Mapper Tasks The number of mapper tasks you

want to assign to this job. The sizeof the inputs should determine thenumber of mapper tasks. Typicallythere should be between 10-100 mapsper node, though you can specify ahigher number for mapper tasks thatare not CPU-intensive.

Number of Reducer Tasks The number of reducer tasks you wantto assign to this job. Lower numbersmean that the reduce operationscan launch immediately and starttransferring map outputs as the mapsfinish. The higher the number, thequicker the nodes will finish their firstround of reduces and launch a secondround. Increasing the number of reduceoperations increases the Hadoopframework overhead, but improves loadbalancing. If this is set to 0, then noreduce operation is performed, and theoutput of the mapper will be returned;also, combiner operations will also notbe performed.

Enable Blocking Forces the job to wait until each stepcompletes before continuing to the nextstep. This is the only way for PDI to beaware of a Hadoop job's status. If leftunchecked, the Hadoop job is blindlyexecuted, and PDI moves on to thenext step. Error handling/routing will notwork unless this option is checked.

Logging Interval Number of seconds between logmessages.

Hadoop Transformation Job ExecutorThis job entry executes transformations that require Hadoop data sources. This is frequently used to executetransformations that act as mappers and reducers in lieu of a traditional Hadoop Java class. The User Defined tab isfor Hadoop option name/value pairs that are not defined in the Job Setup and Cluster tabs.

General

Option DefinitionName The name of this Hadoop Job Executer

step instanceHadoop Job Name The name of the Hadoop job you are

executing

Map/Reduce

Option DefinitionMapper Transformation The KTR that will perform the mapping

functions for this job.

Page 30: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

30 | Pentaho BI Suite Official Documentation | PDI Job Entry Reference

Option DefinitionMapper Input Step Name The name of the step that receives

mapping data from Hadoop. This mustbe an injector step.

Mapper Output Step Name The name of the step that passesmapping output back to Hadoop. Thismust be a dummy step.

Combiner Transformation The KTR that will perform the combinerfunctions for this job.

Combiner Input Step Name The name of the step that receivescombiner data from Hadoop. This mustbe an injector step.

Combiner Output Step Name The name of the step that passescombiner output back to Hadoop. Thismust be a dummy step.

Reducer Transformation The KTR that will perform the reducerfunctions for this job.

Reducer Input Step Name The name of the step that receivesreducing data from Hadoop. This mustbe an injector step.

Reducer Output Step Name The name of the step that passesreducing output back to Hadoop. Thismust be a dummy step.

Job Setup

Option DefinitionOutput Key Class The Apache Hadoop class name that

represents the output key's data type.Output Value Class The Apache Hadoop class name that

represents the output value's data type.Input Path The path to your input file on the

Hadoop cluster.Output Path The path to your output file on the

Hadoop cluster.Input Format The Apache Hadoop class name that

represents the input file's data type.Output Format The Apache Hadoop class name that

represents the output file's data type.

Cluster

Option DefinitionWorking Directory The temporary job work directory on

your Hadoop cluster.HDFS Hostname Hostname for your Hadoop cluster.HDFS Port Port number for your Hadoop cluster.Job Tracker Hostname If you have a separate job tracker node,

type in the hostname here. Otherwiseuse the HDFS hostname.

Job Tracker Port Job tracker port number; this cannot bethe same as the HDFS port number.

Number of Mapper Tasks The number of mapper tasks youwant to assign to this job. The sizeof the inputs should determine thenumber of mapper tasks. Typicallythere should be between 10-100 mapsper node, though you can specify a

Page 31: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | PDI Job Entry Reference | 31

Option Definitionhigher number for mapper tasks thatare not CPU-intensive.

Number of Reducer Tasks The number of reducer tasks you wantto assign to this job. Lower numbersmean that the reduce operationscan launch immediately and starttransferring map outputs as the mapsfinish. The higher the number, thequicker the nodes will finish their firstround of reduces and launch a secondround. Increasing the number of reduceoperations increases the Hadoopframework overhead, but improves loadbalancing. If this is set to 0, then noreduce operation is performed, and theoutput of the mapper will be returned;also, combiner operations will also notbe performed.

Enable Blocking Forces the job to wait until each stepcompletes before continuing to the nextstep. This is the only way for PDI to beaware of a Hadoop job's status. If leftunchecked, the Hadoop job is blindlyexecuted, and PDI moves on to thenext step. Error handling/routing will notwork unless this option is checked.

Logging Interval Number of seconds between logmessages.

Pig Script ExecutorExecutes a script written in Apache Pig's "Pig Latin" language on a Hadoop cluster.

Note: All log entries pertaining to this script execution that are generated by Apache Pig will show in the PDIlog.

General

Option DefinitionJob Entry Name The name of this Pig Script Executor

instance.HDFS hostname The hostname of the machine that

operates a Hadoop distributedfilesystem.

HDFS port The port number of the machinethat operates a Hadoop distributedfilesystem.

Job tracker hostname The hostname of the machine thatoperates a Hadoop job tracker.

Job tracker port The port number of the machine thatoperates a Hadoop job tracker.

Pig script The path (remote or local) to the PigLatin script you want to execute.

Enable blocking If checked, the Pig Script Executor jobentry will prevent downstream entriesfrom executing until the script hasfinished processing.

Page 32: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

32 | Pentaho BI Suite Official Documentation | PDI Job Entry Reference

Option DefinitionLocal execution Executes the script within the same

Java virtual machine that PDI is runningin. This option is useful for testing anddebugging because it does not requireaccess to a Hadoop cluster. Whenthis option is selected, the HDFS andjob tracker connection details are notrequired and their corresponding fieldswill be disabled.

Script Parameters

Option Definition# The order of execution of the script

parameters.Parameter name The name of the parameter you want to

use.Value The value you're substituting whenever

the previously defined parameter isused.

Page 33: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | Hadoop to PDI Data Type Conversion | 33

Hadoop to PDI Data Type Conversion

The Hadoop Job Executor and Hadoop Transformation Job Executor steps have an advanced configuration modethat allows you to specify data types for the job's input and output. PDI is unable to detect foreign data types on itsown; therefore you must specify the input and output data types in the Job Setup tab. The table below explains therelationship between Apache Hadoop data types and their PDI equivalents.

PDI (Kettle) Data Type Apache Hadoop Data Typejava.lang.Integer org.apache.hadoop.io.IntWritablejava.lang.Long org.apache.hadoop.io.IntWritablejava.lang.Long org.apache.hadoop.io.LongWritableorg.apache.hadoop.io.IntWritable java.lang.Longjava.lang.String org.apache.hadoop.io.Textjava.lang.String org.apache.hadoop.io.IntWritableorg.apache.hadoop.io.LongWritable org.apache.hadoop.io.Textorg.apache.hadoop.io.LongWritable java.lang.Long

Page 34: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

34 | Pentaho BI Suite Official Documentation | Hadoop Hive-Specific SQL Limitations

Hadoop Hive-Specific SQL Limitations

There are a few key limitations in Hive that prevent some regular Metadata Editor features from working as intended,and will limit the structure of your SQL queries in Report Designer:

• Outer joins are not supported.• Each column can only be used once in a SELECT clause. Duplicate columns in SELECT statements will cause

errors.• Conditional joins can only use the = conditional unless you use a WHERE clause. Any non-equal conditional

in a FROM statement will force Metadata Editor to use a cartesian join and a WHERE clause conditional to limit it.This is not much of a limitation, but it will seem unusual to experienced Metadata Editor users who are accustomedto working with SQL databases.

Page 35: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

Pentaho BI Suite Official Documentation | Adding a JDBC Driver | 35

Adding a JDBC Driver

Before you can connect to a data source in any Pentaho server or client tool, you must first install the appropriatedatabase driver. Your database administrator, CIO, or IT manager should be able to provide you with the proper driverJAR. If not, you can download a JDBC driver JAR file from your database vendor or driver developer's Web site. Onceyou have the JAR, follow the instructions below to copy it to the driver directories for all of the BI Suite components thatneed to connect to this data source.

Note: Microsoft SQL Server users frequently use an alternative, non-vendor-supported driver called JTDS. Ifyou are adding an MSSQL data source, ensure that you are installing the correct driver.

Backing up old drivers

You must also ensure that there are no other versions of the same vendor's JDBC driver installed in these directories.If there are, you may have to back them up and remove them to avoid confusion and potential class loading problems.This is of particular concern when you are installing a driver JAR for a data source that is the same database typeas your Pentaho solution repository. If you have any doubts as to how to proceed, contact your Pentaho supportrepresentative for guidance.

Installing JDBC drivers

Copy the driver JAR file to the following directories, depending on which servers and client tools you are using(Dashboard Designer, ad hoc reporting, and Analyzer are all part of the BI Server):

Note: For the DI Server: before copying a new JDBC driver, ensure that there is not a different version of thesame JAR in the destination directory. If there is, you must remove the old JAR to avoid version conflicts.

• BI Server: /pentaho/server/biserver-ee/tomcat/lib/• Enterprise Console: /pentaho/server/enterprise-console/jdbc/• Data Integration Server: /pentaho/server/data-integration-server/tomcat/webapps/pentaho-di/

WEB-INF/lib/

• Data Integration client: /pentaho/design-tools/data-integration/libext/JDBC/• Report Designer: /pentaho/design-tools/report-designer/lib/jdbc/• Schema Workbench: /pentaho/design-tools/schema-workbench/drivers/• Aggregation Designer: /pentaho/design-tools/agg-designer/drivers/• Metadata Editor: /pentaho/design-tools/metadata-editor/libext/JDBC/

Note: To establish a data source in the Pentaho Enterprise Console, you must install the driver in both theEnterprise Console and the BI Server or Data Integration Server. If you are just adding a data source throughthe Pentaho User Console, you do not need to install the driver to Enterprise Console.

Restarting

Once the driver JAR is in place, you must restart the server or client tool that you added it to.

Connecting to a Microsoft SQL Server using Integrated or Windows Authentication

The JDBC driver supports Type 2 integrated authentication on Windows operating systems through theintegratedSecurity connection string property. To use integrated authentication, copy the sqljdbc_auth.dll file to allthe directories to which you copied the JDBC files.

The sqljdbc_auth.dll files are installed in the following location:

<installation directory>\sqljdbc_<version>\<language>\auth\

Note: Use the sqljdbc_auth.dll file, in the x86 folder, if you are running a 32-bit Java Virtual Machine (JVM)even if the operating system is version x64. Use the sqljdbc_auth.dll file in the x64 folder, if you are running a64-bit JVM on a x64 processor. Use the sqljdbc_auth.dll file in the IA64 folder, you are running a 64-bit JVM onan Itanium processor.

Page 36: Using Hadoop With Pentaho Data Integration - Huihoodocs.huihoo.com/pentaho/pentaho-business-analytics/4.0/hadoop...Integration for Hadoop package, and the desktop client tools needed

36 | Pentaho BI Suite Official Documentation | Adding a JDBC Driver

Adding a JDBC Driver to HadoopYou must ensure that your Hadoop nodes have a JDBC driver JAR for every database they will connect to. If you aremissing any drivers, copy the JAR files to the /lib/ subdirectory in your Hadoop home.

Note: The Pentaho Data Integration client tools come with many common JDBC drivers in the /pentaho/design-tools/data-integration/libext/JDBC/ directory that you can use in Hadoop.

cp /tmp/downloads/mysql-connector-java-3.1.14-bin.jar /hadoop-0.20.2/lib/