您的位置:首页 > 其它

Kettle 中常用 控件一览

2017-09-01 14:22 435 查看
Data Grid:

The Data Grid step allows you to enter a static list of rows in a grid.  This is usually done for testing, reference or demo purposes.

Calculator:

对一个表结构数据,至多对其中三列进行计算,生成新的一列

Switch/Case:

根据某一列的值,route the row data to different target step. (Value那列留空就表示null)

Dummy:

不执行任何操作, 用于示意

Select Values(Select/Rename values):

在数据流中选择某几列,或重命名某一列

比如向MSSQL server input数据, 可以用这个控件把时间转成string输出到MSSQL server的datetime类型的列, 而把bool类型的值转成integer输出到MSSQL server 的 bit类型的列中

Data Validator:

可以添加规则来验证数据

Unique Rows:

数据去重, 需要数据被排序好

Filter Rows:

选取满足条件的行, 有点类似Switch/Case ,但是只有两条分支, 但条件可以更加复杂.

User Defined Java Class:

类似SSIS的script task 提供对行级别数据的编程处理

User Defined Java Expression:

比User Defined Java Class简单, 只是一行Java的转换

Write to log:

记日志

Database lookup:

The Database lookup step allows you to look up values in a database table. Lookup values are added as new fields onto the stream.

比如向事实表里插入数据时, 获取维度的代理键就可以用这个控件.

Stream lookup:

类似Database lookup, 但是可以对多种数据源进行lookup.

The data coming from the Source step is first read into memory and is then used to look up data from the main stream.

Generate Rows:

生成若干行空数据, 为每一列定义好类型.

Add sequence:

生成自增序列, 可以和"Generate Rows"联用. 填充那些空行

Join Rows:

对两个输入做笛卡尔积

Set Variables:

This step allows you to set variables in a job or in the virtual machine. It accepts one (and only one) row of data to set the value of a variable.


IMPORTANT : IT IS NOT POSSIBLE TO SET AND USE A VARIABLE IN THE SAME
TRANSFORMATION.  This is because all steps run in parallel.

在Job的一步里set了一个变量后, 在job的下一步里可以用${variable}来调用这个变量

在同一个transformation里variables 是不互通的, 在kettle的理念里变量是用来在Job级别通信用的, 而在transformation里可以直接用上一步的返回结果集(stream) 来做下一步的输入参数, 因此不会用到变量.如下图:



Input/Update:

适用于类型1的渐变维度, 直接替换



Dimension Lookup-Update:

The Dimension Lookup/Update step allows you to implement Ralph Kimball's slowly changing dimension for both types: Type I (update) and Type II (insert) together with some additional functions.

Not only can you use this step to update a dimension table, it may also be used to look up values in a dimension.

用于处理类型2的渐变维度

Add Constants:

为一个stream增加有固定值的列.

Field Splitter:

把一个列拆分成好几列, 详见:点击打开链接

Add a CheckSum:

使用CRC 32 等算法, 对一行数据生成一个值, 可以用来比对数据源和destination之间是否有差异, 以决定是否update
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: