为整个作业设置变量——kettle参数和变量使用

1 kettle使用参数时,如果参数位置是字符串(数字也可以加),最好加引号

eg:

2 kettle设置变量为整个作业使用

2.1 整个作业的预览图

  • 在这个作业里面,从“转换设置变量” 开始之后的各个分支不是并发执行的,执行的先后顺序是各个分支被连接的顺序

2.2 设置变量

  • 图中数据库连接查询,各个之间没有关联,只是为了从不同的数据库查询需要的值。
  • 设置环境变量,“字段值:”字段名称是前面sql语句的,不可改变;“变量名” 是我们给定的,在只有需要使用是 ,使用>${} 就可以使用,但是设置的变量不能在本次转换中使用。
  • 需要给定变量的活动类型。一般整个作业的其他转换都需要使用这些变量,直接给定“Vaild in tht root job”

这是执行输出的详细日志

2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 转换已经从资源库预先载入.
2017/03/18 12:56:57 - Spoon - 转换已经打开.
2017/03/18 12:56:57 - Spoon - 正在打开转换 [20170318test_param_setPara_tran1_2]...
2017/03/18 12:56:57 - Spoon - 开始执行转换.
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 为了转换解除补丁开始  [20170318test_param_setPara_tran1_2]
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 已经找到的参数数量:0
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 这没有一个重放的转换
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 我找到 3 个不同的要执行的步骤.
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 分派记录集...
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  正在分配行组为步骤 0 --> fin_lrb_out
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -   前一个副本 = 1, 下一个副本=1
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 转换分配了新的行组 [fin_lrb_out.0 - 文本文件输出.0]
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  已分配 1 行组为步骤 0 --> fin_lrb_out
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  正在分配行组为步骤 1 --> 文本文件输出
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -   前一个副本 = 1, 下一个副本=1
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 转换分配了新的行组 [文本文件输出.0 - Transformation Executor.0]
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  已分配 2 行组为步骤 1 --> 文本文件输出
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  正在分配行组为步骤 2 --> Transformation Executor
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  已分配 2 行组为步骤 2 --> Transformation Executor
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 正在分配步骤和步骤数据...
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  转换大约分配了 步骤 [fin_lrb_out] 类型的 [TableInput]
2017/03/18 12:56:57 - fin_lrb_out.0 - 分散被激活
2017/03/18 12:56:57 - fin_lrb_out.0 - Starting allocation of buffers & new threads...
2017/03/18 12:56:57 - fin_lrb_out.0 - 步骤信息: 输入数量=0 输出数量=1
2017/03/18 12:56:57 - fin_lrb_out.0 - output rel. is  1:1
2017/03/18 12:56:57 - fin_lrb_out.0 - 发现输出 rowset [fin_lrb_out.0 - 文本文件输出.0]
2017/03/18 12:56:57 - fin_lrb_out.0 - 完成分发
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  转换已经分配了一个新的步骤: [fin_lrb_out].0
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  转换大约分配了 步骤 [文本文件输出] 类型的 [TextFileOutput]
2017/03/18 12:56:57 - 文本文件输出.0 - 分散被激活
2017/03/18 12:56:57 - 文本文件输出.0 - Starting allocation of buffers & new threads...
2017/03/18 12:56:57 - 文本文件输出.0 - 步骤信息: 输入数量=1 输出数量=1
2017/03/18 12:56:57 - 文本文件输出.0 - 获取来自前一步骤 [文本文件输出] #0 --> fin_lrb_out
2017/03/18 12:56:57 - 文本文件输出.0 - input rel is 1:1
2017/03/18 12:56:57 - 文本文件输出.0 - 发现输入记录集合 [fin_lrb_out.0 - 文本文件输出.0]
2017/03/18 12:56:57 - 文本文件输出.0 - output rel. is  1:1
2017/03/18 12:56:57 - 文本文件输出.0 - 发现输出 rowset [文本文件输出.0 - Transformation Executor.0]
2017/03/18 12:56:57 - 文本文件输出.0 - 完成分发
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  转换已经分配了一个新的步骤: [文本文件输出].0
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  转换大约分配了 步骤 [Transformation Executor] 类型的 [TransExecutor]
2017/03/18 12:56:57 - Transformation Executor.0 - 分散被激活
2017/03/18 12:56:57 - Transformation Executor.0 - Starting allocation of buffers & new threads...
2017/03/18 12:56:57 - Transformation Executor.0 - 步骤信息: 输入数量=1 输出数量=0
2017/03/18 12:56:57 - Transformation Executor.0 - 获取来自前一步骤 [Transformation Executor] #0 --> 文本文件输出
2017/03/18 12:56:57 - Transformation Executor.0 - input rel is 1:1
2017/03/18 12:56:57 - Transformation Executor.0 - 发现输入记录集合 [文本文件输出.0 - Transformation Executor.0]
2017/03/18 12:56:57 - Transformation Executor.0 - 完成分发
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 -  转换已经分配了一个新的步骤: [Transformation Executor].0
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 这项转换可以被回放 回放日期是: 2017/03/18 12:56:57
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 正在初始化 3 步骤...
2017/03/18 12:56:57 - fin_lrb_out.0 - Released server socket on port 0
2017/03/18 12:56:57 - 文本文件输出.0 - Released server socket on port 0
2017/03/18 12:56:57 - mysql_my - New database connection defined
2017/03/18 12:56:57 - 文本文件输出.0 - Parent folder exists [file:///E:/kettle/pdi-ce-6.1.0.1-196/data-integration/kettle/step1]!
2017/03/18 12:56:57 - 文本文件输出.0 - Opening output stream using provider: None
2017/03/18 12:56:57 - 文本文件输出.0 - Opening output stream in encoding: GBK
2017/03/18 12:56:57 - 文本文件输出.0 - Opened new file with name [file:///E:/kettle/pdi-ce-6.1.0.1-196/data-integration/kettle/step1/file1_2_20170318.txt]
2017/03/18 12:56:57 - Transformation Executor.0 - Released server socket on port 0
2017/03/18 12:56:57 - mysql_my - Auto commit off
2017/03/18 12:56:57 - fin_lrb_out.0 - Connected to database...
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 步骤 [fin_lrb_out.0] 初始化不完全,有缺陷.
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 步骤 [文本文件输出.0] 初始化不完全,有缺陷.
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 步骤 [Transformation Executor.0] 初始化不完全,有缺陷.
2017/03/18 12:56:57 - fin_lrb_out.0 - 开始运行...
2017/03/18 12:56:57 - fin_lrb_out.0 - SQL query : SELECT * FROM fin_lrb_out WHERE bbyf>='2016-10' and bbyf<=2018-10
2017/03/18 12:56:57 - 文本文件输出.0 - 开始运行...
2017/03/18 12:56:57 - Transformation Executor.0 - 开始运行...
2017/03/18 12:56:57 - 20170318test_param_setPara_tran1_2 - 转换已经分配了 3 线程 和 2 列组.
2017/03/18 12:56:57 - fin_lrb_out.0 - Finished reading query, closing connection.
2017/03/18 12:56:57 - mysql_my - Connection to database closed!
2017/03/18 12:56:57 - fin_lrb_out.0 - 完成处理 (I=0, O=0, R=0, W=0, U=0, E=0)
2017/03/18 12:56:57 - 文本文件输出.0 - 完成处理 (I=0, O=0, R=0, W=0, U=0, E=0)
2017/03/18 12:56:57 - Transformation Executor.0 - 完成处理 (I=0, O=0, R=0, W=0, U=0, E=0)
2017/03/18 12:56:57 - Spoon - 转换完成!!
  • 4
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值