当前位置:网站首页>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
边栏推荐
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型、使用summary函数查看简单模型的汇总统计信息
- 15 BS object Node name Node name String get nested node content
- Stream常用操作以及原理探索
- Where do people get their top energy?
- Unity 利用Skybox Panoramic着色器制作全景图预览有条缝隙问题解决办法
- Kubernetes的pod调度
- The intersect function in the dplyr package of R language obtains the data lines that exist in both dataframes and the data lines that cross the two dataframes
- R语言dplyr包summarise_at函数计算dataframe数据中多个数据列(通过向量指定)的均值和中位数、指定na.rm参数配置删除缺失值
- [solo π] ADB connects multiple mobile phones
- Excel-VBA 快速上手(二、条件判断和循环)
猜你喜欢

【雲原生】 ”人人皆可“ 編程的無代碼 iVX 編輯器

印尼投资部长:鸿海考虑在其新首都建立电动公交系统、城市物联网

Mark一下 Unity3d在Inspector中选中不了资源即Project锁定问题

Bank of Beijing x Huawei: network intelligent operation and maintenance tamps the base of digital transformation service

人的顶级能量从哪里获取?

Naacl2022: (code practice) good visual guidance promotes better feature extraction, multimodal named entity recognition (with source code download)

Detailed explanation of C language programming problem: can any three sides form a triangle, output the area of the triangle and judge its type

乐鑫 AWS IoT ExpressLink 模组达到通用可用性

备战数学建模30-回归分析2

Attention meets geometry: geometry guided spatiotemporal attention consistency self supervised monocular depth estimation
随机推荐
R语言caTools包进行数据划分、scale函数进行数据缩放、class包的knn函数构建K近邻分类器
R语言dplyr包intersect函数获取在两个dataframe中都存在的数据行、获取两个dataframe交叉的数据行
MHA high availability coordination and failover
cluster addslots建立集群
redis集群的重新分片与ASK命令
Pod of kubernetes
杜老师说网站更新图解
打新债注册开户安全吗,有没有什么风险?
teamviewer显示设备数量上限解决方法
获取两个dataframe的交并差集
乐鑫 AWS IoT ExpressLink 模组达到通用可用性
Numpy基本使用
Kubernetes的pod调度
Optimizing for vectorization
[solo π] ADB connects multiple mobile phones
NAACL2022:(代码实践)好的视觉引导促进更好的特征提取,多模态命名实体识别(附源代码下载)...
Mark一下 Unity3d在Inspector中选中不了资源即Project锁定问题
Cluster addslots establish a cluster
10分钟了解BIM+GIS融合,常见BIM数据格式及特性
Is it safe to open a stock account with the account manager online??