当前位置:网站首页>Restcloud ETL extracting dynamic library table data
Restcloud ETL extracting dynamic library table data
2022-06-24 17:42:00 【User 8905905】
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 classETL_T00005_1INWBJPUXVB implements IETLBaseEvent {
@Override
public String execute(IETLBaseProcessEngine engine, Document modelNodeDoc, Document indoc,String fieldId,String params) throws Exception {
Date date = newDate();
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
边栏推荐
- Install MySQL using Yum for Linux
- 电子元器件行业B2B电商市场模式、交易能力数字化趋势分析
- SQL basic tutorial (learning notes)
- Redis source code analysis RDB
- Issue 003 how to detect whether a sticky positioned element is in a pinned state
- Continue to help enterprises' digital transformation -tce has obtained the certification of the first batch of digital trusted service platforms in China
- Cloud native monitoring configuration self built alertmanager to realize alarm
- How to troubleshoot and solve the problem that the ultra-low delay security live broadcast system webrtc client plays no audio in the browser?
- You don't know about this inspection platform. It's a big loss!
- Can the money invested in financial products be withdrawn at any time?
猜你喜欢

How to decompile APK files

Constantly changing the emergency dialing of harmonyos ETS during the new year
Using consistent hash algorithm in Presto to enhance the data cache locality of dynamic clusters

NVM download, installation and use

Number of occurrences of numbers in the array (medium difficulty)

Mengyou Technology: tiktok current limiting? Teach you to create popular copywriting + popular background music selection

Five skills of selecting embedded programming language

Etching process flow for PCB fabrication

Error reported after NPM I

How to create simple shapes in illustrator 2022
随机推荐
Devops in digital transformation digital risk
FPGA systematic learning notes serialization_ Day10 [sequential logic, competitive adventure, synchronous reset, asynchronous reset]
Implementation of pure three-layer container network based on BGP
Solutions for RTSP video streaming played by several browsers
EasyGBS视频平台TCP主动模式拉流异常情况修复
Explanation of MySQL indexing principle
Using easyjson to improve the efficiency of serialization transmission
[2021 taac & Ti-One] frequently asked questions related to Ti-One products
视频平台如何将旧数据库导入到新数据库?
Design topic: MATLAB cellular automata personnel evacuation
Conditional competition overview
Explanation of pod DNS configuration & cases of DNS resolution failure
[go language development] start to develop Meitu station from 0 - Lesson 5 [receive pictures and upload]
How to learn go language happily? Let's go!
Using consistent hash algorithm in Presto to enhance the data cache locality of dynamic clusters
How to use rdbtools to analyze redis large keys
What is the problem that the data is not displayed on the login web page after the configuration of the RTSP video security intelligent monitoring system easynvr is completed
Install MySQL using Yum for Linux
Common GCC__ attribute__
SQL basic tutorial (learning notes)