从官方例子入手 (详解排序、分组)——kettle实战(3)

最近感冒更新的比较慢,惭愧。

老大让我这段日子看一下这款工具关于外部调用服务远程调用检验这几个方面的东西,以后会用到。

那么我们就从官方例子入手吧,下面这个例子挺有意思的,算是有标志性,那么我们来看看它吧。

一、订单数据(generate order data

*/data-integration\samples\transformations\data-generator\generate order data.ktr

例子的路径如上, *为kettle的安装(解压)路径

这里写图片描述

一、 生成记录

第一个是生成记录,相当于是开辟了若干个数据空间
只需要设置数量就好

二、 生成随机数据

JS代码

第二个是生成随机数据
代码如下:

```

// 1M customers
var customerId = Math.round( Math.random() * 1000000 );

// 1000 products
var productId = Math.round( Math.random() * 1000 );

// Order date
var orderDate = new Date(2000+Math.round( Math.random() * 6), Math.round( Math.random() * 12 ), Math.round( Math.random() * 31 ));

// Discount % : between 0 and 20% in 5% blocks
var discountPct = Math.round( Math.random() * 4 ) * 5;

// Number of products : between 1 and 5
var nrProducts = 1 + Math.round( Math.random() * 4 );


var orderSeq=Math.round( Math.random() * 5 );

```

在点击获取变量后会产生以下字段,其中的类型长度什么的应该需要后期调整。

字段名称 改名为 类型
  • 1
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值