You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by 12862930 <xi...@qq.com> on 2021/01/27 07:35:04 UTC

回复:pyflink 1.11 connector数据读取问题

写个程序自动根据表的元数据生成ddl语句



---原始邮件---
发件人: "肖越"<18242988825@163.com&gt;
发送时间: 2021年1月27日(周三) 下午3:29
收件人: "user-zh"<user-zh@flink.apache.org&gt;;
主题: pyflink 1.11 connector数据读取问题


目前通过 connector 定义ddl的方式,通过数据库读取数据,方式如下:
CREATE TABLE MyUserTable (
&nbsp; id BIGINT,
&nbsp; name STRING,
&nbsp; age INT,
&nbsp; status BOOLEAN,
&nbsp; PRIMARY KEY (id) NOT ENFORCED
) WITH (
&nbsp;&nbsp; 'connector' = 'jdbc',
&nbsp;&nbsp; 'url' = 'jdbc:mysql://localhost:3306/mydatabase',
&nbsp;&nbsp; 'table-name' = 'users'
);
每次表格获取及定义都需要定义数据类型(如例子中: BIGINT,STRING,INT,BOOLEN),
请问大佬是否有其他从数据库读取方式,可以不用定义数据类型??