当前位置:网站首页>Kettle experiment conversion case
Kettle experiment conversion case
2022-04-23 09:14:00 【Wind combed smoke】
1. Conversion case
The easiest case to implement is to generate random numbers , And store it to txt file Create a new transformation and save it as test_random( The suffix is .ktr) Drag and drop plug-ins , In the core object -> Drag input and output respectively “ Generate random number ” and “ Text file output ” Two buttons , And then click “ Generate random number ” And press shift key , Point to with the mouse “ Text file output ”, In order to produce a scissor , Indicates the flow of data . Here's the picture :
Edit input stream , namely “ Generate random number ” Button , As shown in the figure
2. Conversion case
Then edit the output stream , namely “ Text file output ” Button , As shown in the figure
View results , As shown in the figure
3. Formal experiment
Through these simple experiments , We know the basic operation of the I / O stream , Next, we enter the formal experiment
1) Change the input and output of the above experiments to Excel. The configuration is as follows : Excel Input :
Under file options , The table type is adapted according to the actual situation (xls or xlsx), After a file or directory , Click on “ Browse ” Choose your own source data file , And then click “ add to ”;
Under worksheet options , Click on “ Get sheet name ...” Add sheet , namely Excel Medium sheet1;
Under field options , Click on “ Get the fields from the header data ...” Get fields automatically , Because of the original Excel The transfer in of middle integer data will become floating point data , So it needs to be changed , As shown in the figure :
1) Change the input and output of the above experiments to Excel
The configuration is as follows : Excel Output : Just configure the output filename , Others are default .
2) The core steps that need to be handled in the next step , That is, switching . First, generate data for 1 Analyze , because kettle The middle group needs to be sorted first , So we need to deal with :
(1) Cut off the registration date and time to ;
(2) Change age according to certain criteria ( Define your own );
(3) Sort by fields to be grouped ;
(4) Group statistics . According to the above ideas , stay “ transformation ” and “ Statistics ” In the core object , Find the corresponding components respectively , Complete basic data flow node configuration , As shown in the figure :
stay “ Field selection ” In the component , Deal with time . In the metadata options , Need to be right Date Convert to String, Format to yyyy-MM-dd, At the same time, you can rename the field . In addition, you can select fields , modify , remove . As shown in the figure :
3) stay “ Range of values ” In the component , Deal with age , The dividing standard defines itself , As shown in the figure :
4) stay “ sort record ” In the component , According to the requirements of generating data , Need to date , Gender , Sort by age , As shown in the figure :
5) stay “ grouping ” In the component , Group statistics , As shown in the figure :
6) perform , The result is shown in the figure :
版权声明
本文为[Wind combed smoke]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230907157666.html
边栏推荐
- [SQL Server fast track] view and cursor of database
- [indexof] [lastIndexOf] [split] [substring] usage details
- Single sign on SSO
- 653. Sum of two IV - input BST
- SAP 101K 411k inventory change
- ATSS(CVPR2020)
- L2-022 重排链表 (25 分)(map+结构体模拟)
- How to render web pages
- What is augmented reality technology? Where can it be used?
- ALV树(LL LR RL RR)插入删除
猜你喜欢
Non duplicate data values of two MySQL query tables
Star Trek's strong attack opens the dream linkage between metacosmic virtual reality
nn. Explanation of module class
SAP 101K 411k inventory change
To remember the composition ~ the pre order traversal of binary tree
三、6【Verilog HDL】基础知识之门级建模
Machine learning (VI) -- Bayesian classifier
112. Path sum
資源打包關系依賴樹
爬虫使用xpath解析时返回为空,获取不到相应的元素的原因和解决办法
随机推荐
【SQL server速成之路】数据库的视图和游标
Go language self-study series | golang nested structure
kettle实验
Brief steps to build a website / application using flash and H5
Principle of synchronized implementation
Project upload part
Distributed message oriented middleware framework selection - Digital Architecture Design (7)
A must see wechat applet development guide 1 - basic knowledge
Please arrange star trek in advance to break through the new playing method of chain tour, and the market heat continues to rise
Machine learning (VI) -- Bayesian classifier
Go language self-study series | initialization of golang structure
Single chip microcomputer nixie tube stopwatch
Introduction to matlab
搞不懂时间、时间戳、时区,快来看这篇
[boutique] using dynamic agent to realize unified transaction management II
Flink同时读取mysql与pgsql程序会卡住且没有日志
tsdf +mvs
Valgrind et kcachegrind utilisent l'analyse d'exécution
Bk3633 specification
2D 01 Backpack