zoukankan      html  css  js  c++  java
  • ETL工具Kettle使用

    1.下载kettle:https://sourceforge.net/projects/pentaho/files/Data%20Integration/7.0/pdi-ce-7.0.0.0-25.zip/download

    说明:kettle 是pentaho收购的一个etl工具,pentaho是一家BI解决方案的商业公司。

    2.解压文件:pdi-ce-7.0.0.0-25.zip,执行:spoon.bat

    3.在mysql中创建两个数据库:test1和test2,在test1中创建user1表,在test2中创建user2表用来测试

    3.测试操作数据库test1中的user1表和数据库test2中的user2表

    3.1 新建一个转换(transformation),点击DB连接,选择对应数据库类型,创建两个连接:l1,l2.

    若测试连接出现错误:

    错误连接数据库 [localhost_3306] : org.pentaho.di.core.exception.KettleDatabaseException:
    Error occurred while trying to connect to the database
     
    Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
    org.gjt.mm.mysql.Driver
    将mysql-connector-java-5.1.38-bin.jar拷贝至目录:pdi-ce-7.0.0.0-25data-integrationlib下 ,重启程序,新建DB连接:
     
    3.2 在【核心对象】下的【输入】中找到【表输入】,双击鼠标左键将【表输入】添加到“转换的图形视图”中,然后在【输出】找到【插入/更新】添加到“转换的图形视图”中,效果如下:
     
     
    3.3 在视图中双击【表输入】,选择输入数据库和修改所需SQL查询语句:
     
     
    3.4  双击【插入/更新】,选好要插入的数据库和表,再点击【获取字段】,【获取和更新字段】:
     
    3.5 此时,可点击【运行】或F9,执行此转换,成功后的user2表如下图:
     
    3.6 设置定时执行转换:新建一个job,将【START】和【转换】添加到视图中,设置关联转换文件和定时时间:
     
    设置好后,点击【运行】,就会根据你设置的时间间隔来执行相应的“转化”了。
  • 相关阅读:
    Hard Rock
    Codeforces Round #416 (Div. 2) B. Vladik and Complicated Book
    codeforces 793B. Igor and his way to work
    codeforces 1B Spreadsheets
    HDU 1069 Monkey and Banana
    codeforces 2B The least round way
    【机器学习】 通俗说拟合
    python-八皇后问题
    python-核心知识思维导图
    python-@property 属性
  • 原文地址:https://www.cnblogs.com/Jian-Zhang/p/8721575.html
Copyright © 2011-2022 走看看