当前位置:网站首页>Restcloud ETL extracting dynamic library table data
Restcloud ETL extracting dynamic library table data
2022-06-26 15:04:00 【RestCloud】

RestCloud ETL Community Edition is a data integration tool , Provide visual multi data pipeline construction 、 Data source management 、 Operation monitoring and authority management functions .
1. The scene that :
For some business systems, a new data table is generated automatically every day , Hope to pass 1 Data flow automatically reads the data table of the day every day . Such as 2022 year 6 month 1 The name of daily production table is “table_20220601”,2022 year 6 month 2 The name of daily production table is “table_20220602”, And so on ; For such dynamic tables , How to use RestCloud ETL Simple 、 Convenient data extraction .
2. Realization principle :
First, we need to automatically generate the name of the table according to the date , And transfer the parameter to the library table input component . The implementation flow chart is as follows :

The prerequisite for this service is that the library table input component supports receiving variable transmission , This RestCloud ETL Unparalleled advantages .
3. Implementation steps :
3.1 To configure " perform Java Script "
Right click " perform Java Script ", Click on “ Node properties ” Open the configuration edit page , Click next , edit Java Code . Add the generated table name code to the code , The output parameters are : p_tablename , Here's the picture :

The code is as follows :
package cn.restcloud.etl.rule.ext;
import org.apache.commons.lang3.StringUtils;
import org.bson.Document;
import java.sql.Connection;
import cn.restcloud.framework.core.context.*;
import cn.restcloud.etl.base.IETLBaseEvent;
import cn.restcloud.etl.base.IETLBaseProcessEngine;
import cn.restcloud.framework.core.util.*;
import cn.restcloud.framework.core.util.db.rdb.*;
import java.util.*;
import java.text.SimpleDateFormat;
/**
indoc Stream data
Successful execution must return characters 1, return 0 Means to terminate the process
*/
public class ETL_T00005_1INWBJPUXVB implements IETLBaseEvent {
@Override
public String execute(IETLBaseProcessEngine engine, Document modelNodeDoc, Document indoc,String fieldId,String params) throws Exception {
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String table = "table_" + sdf.format(date);
PrintUtil.o(table);
indoc.put("p_tablename",table);
return "1";
}
}
Complete code editing , Click on 【 Compile and save 】 Exit configuration .
3.2 Library table input configuration
Right click " Library table input ", Click on “ Node properties ” Open the configuration edit page .
Select source table data source , Click next :

Edit read data SQL sentence ,select * from The name of the table , Table name input receiving parameters , Parameter format :${ Parameters },${p_tablename}, Click next :

Click on 【 New fields 】, Input extraction data table fields , Click Save to complete the configuration .
3.3 Library table output configuration
Right click " Library table input ", Click on “ Node properties ” Open the configuration edit page .


Enter the configuration in sequence , Select data source , Load database tables , Select database table .

Click on 【 Read from the table 】, Check keyword ( Primary key ), Click next .

Select the corresponding journal policy as required , Click Save to complete the configuration .
4. Run the test
Click on 【 function 】

Click on 【 Began to run 】

5. View the run results

Click library table output , Data transmission statistics


Thank you for your attention and support ! For more features , Please join RestCloud ETL Community free download experience , Download address :https://etl.restcloud.cn
边栏推荐
- Is it safe for flush to register and open an account? Is there any risk?
- Deployment of kubernetes' controller
- Declaration and assignment of go variables
- Use of subqueries
- 国信证券的排名如何?办理股票开户安全吗?
- R语言dplyr包bind_rows函数把两个dataframe数据的行纵向(竖直)合并起来、最终行数为原来两个dataframe行数的加和(Combine Data Frames)
- Execution of commands in the cluster
- Informatics Olympiad all in one 1400: count the number of words (string matching)
- 印尼投资部长:鸿海考虑在其新首都建立电动公交系统、城市物联网
- Stream常用操作以及原理探索
猜你喜欢

Where do people get their top energy?

人力资源导出数据 excel VBA

Authoritative announcement on the recruitment of teachers in Yan'an University in 2022

Redis-集群

This is the graceful file system mounting method, which is effective through personal testing

The heavyweight white paper was released. Huawei continues to lead the new model of smart park construction in the future

北京银行x华为:网络智能运维夯实数字化转型服务底座

Common operation and Principle Exploration of stream
![[solo π] ADB connects multiple mobile phones](/img/44/4bd88725434fb67c9237645f024071.png)
[solo π] ADB connects multiple mobile phones

TS common data types summary
随机推荐
Deployment of kubernetes' controller
信息学奥赛一本通 1400:统计单词数 (字符串匹配)
Use abp Zero builds a third-party login module (II): server development
Pod scheduling of kubernetes
Attention meets geometry: geometry guided spatiotemporal attention consistency self supervised monocular depth estimation
网上找客户经理办理股票开户安全吗??
子查询的使用
clustermeet
kubernetes的Controller之deployment
Redis集群消息
手机股票注册开户安全吗,有没有什么风险?
R语言caTools包进行数据划分、scale函数进行数据缩放、class包的knn函数构建K近邻分类器
NVIDIA SMI error
Pytoch deep learning code skills
Authoritative announcement on the recruitment of teachers in Yan'an University in 2022
redis集群的重新分片与ASK命令
R language uses ggplot2 to visualize the results of Poisson regression model and count results under different parameter combinations
获取两个dataframe的交并差集
NAACL2022:(代码实践)好的视觉引导促进更好的特征提取,多模态命名实体识别(附源代码下载)...
15 bs对象.节点名称.节点名称.string 获取嵌套节点内容