创建一个转换从HBase加载数据
1、首先要连接HBase必须要配置对应的shim包,参考文档
http://wiki.pentaho.com/display/BAD/Configuring+Pentaho+for+your+Hadoop+Distro+and+Version+(Pentaho+Suite+Version+5.1)#ConfiguringPentahoforyourHadoopDistroandVersion(PentahoSuiteVersion5.1)-SetActiveShim 下载地址:
http://sourceforge.net/projects/pentaho/files/Big Data Shims/
a. 下载对应的shim包解压至plugins\\pentaho-big-data-plugin\\hadoop-configurations目录下 b. 配置plugins\\pentaho-big-data-plugin\\plugin.properties 修改选项
active.hadoop.configuration=cdh51
其中cdh51即为你所对应的shim包文件夹名称 2、打开PDI,从菜单选择'File' -> 'New' -> 'Transformation' ,或者在菜单上单击 'New file'图标并选择'Transformation'选项
3、新建HBase Input选项,左侧树形结构中选择 ‘HBase Input' 拖拽至右侧画板处
4、双击图标,并打开 'Create/Edit mappings' 页签,如图:
5、在上图中单击Get table names按钮,从下拉列表中选择需要创建MAPPING的表名,在Mapping name中输入Mapping名称,然后再设置key字段,如下图
注:也可通过脚本将MAPPING记录插入到HBASE中,脚本如下,Table_name为表名 put 'pentaho_mappings','Table_name,MAPPING','key:Key','Binary' put 'pentaho_mappings','Table_name,MAPPING','columns:C,V,A','String'
6、创建完Mapping后,再返回Configure query页签 a. 设置Zookeeper Host(s)
b. 设置Zookeeker post 默认为2181
c. 单击Get mapped table names,从已经创建过MAPPING的列表中选择表名 d. 单击Get mappings or the specified table获取该表MAPPING e. 单击Get Key/Fields Info获取Key字段
7、配置以上步骤后,在kettle中拖拽Split Fields控件,将HBase中STRING字段拆分为单个字段即可