flink 数据源连接

Last updated on September 15, 2024 pm

🧙 Questions

☄️ Ideas

mysql
sql-client.sh

CREATE TABLE from_mysql_table(
  username STRING,
  age INT
) WITH (
    'connector'='jdbc',
    'url'='jdbc:mysql://39.98.36.112:30306/ispong_db',
    'table-name'='users',
    'driver'='com.mysql.cj.jdbc.Driver',
    'username'='root',
    'password'='ispong123'
);

select * from from_mysql_table;
hive
CREATE CATALOG hive_db WITH (
    'type' = 'hive',
    'hive-conf-dir' = '/opt/hive/conf',
    'default-database' = 'default'
);

USE CATALOG hive_db;

select * from ispong_table;
hive 同步到mysql
insert into from_mysql_table select username, cast(age as int) from ispong_table;

flink 数据源连接
https://ispong.isxcode.com/hadoop/flink/flink 数据源连接/
Author
ispong
Posted on
March 8, 2023
Licensed under