Giter Club home page Giter Club logo

bigdata_code_tutorial's Introduction

整库同步代码

https://github.com/SophiaData/Bigdata_Code_Tutorial/blob/master/sync_database_mysql/src/main/java/io/sophiadata/flink/sync/FlinkSqlWDS.java

程序运行效果图

img

运行方法,根据需要修改表名,库名,账号,密码,并将 provided 添加到 IDE 运行环境中, 将 log4j.properties 日志级别输出调整为 info 可以得到 flink web ui 地址

根据需要调整 ParameterUtil 里面的参数,也可以使用 nacos 来获取相应参数

原始建表语句

create table if not exists jdbc_sink_t_user(
	`id` BIGINT NOT NULL,
	`name` VARCHAR(255),
	`age` TINYINT,
	`create_time` TIMESTAMP(0) NOT NULL default '1970-01-01 09:00:00',
	`update_time` TIMESTAMP(0) NOT NULL default '1970-01-01 09:00:00',
PRIMARY KEY (id)
) 
create table if not exists t_user(
	`id` BIGINT NOT NULL,
	`name` VARCHAR(255),
	`age` TINYINT,
	`create_time` TIMESTAMP(0) default '1970-01-01 09:00:00',
	`update_time` TIMESTAMP(0) default '1970-01-01 09:00:00',
PRIMARY KEY (id)
) 
create table if not exists table_process(
	`source_table` VARCHAR(200) NOT NULL,
	`operate_type` VARCHAR(200) NOT NULL,
	`sink_type` VARCHAR(200),
	`sink_table` VARCHAR(200),
	`sink_columns` VARCHAR(2000),
	`sink_pk` VARCHAR(200),
	`sink_extend` VARCHAR(200),
	`slow_change` VARCHAR(2000),
PRIMARY KEY (source_table,operate_type)
) 
create table if not exists test2(
	`id` VARCHAR(200) NOT NULL,
	`student` VARCHAR(200),
	`sex` VARCHAR(200),
	`sexs` VARCHAR(255),
	`op` VARCHAR(255),
	`sc` VARCHAR(255),
	`st` VARCHAR(255),
	`s9` VARCHAR(255),
	`s10` VARCHAR(255),
PRIMARY KEY (id)
) 
create table if not exists test3(
	`id` VARCHAR(200) NOT NULL,
	`student` VARCHAR(200),
	`sex` VARCHAR(200),
	`s11` VARCHAR(200),
PRIMARY KEY (id)
) 

Blog: https://sophiadata.github.io/Bigdata_Blog_Website/

img

bigdata_code_tutorial's People

Contributors

gtk96 avatar xingjieshitu avatar 2kyyds avatar dependabot[bot] avatar huzhiboa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.