Release v1.12.8-cross join unnest使用报错
Search before asking
- [X] I had searched in the issues and found no similar issues.
What happened
What you expected to happen
cross join unnestæ£å¸¸ä½¿ç¨
How to reproduce
ä¸ãç¯å¢åå¤
1ãmysql表
CREATE TABLE test_jons (
id bigint(20) NOT NULL AUTO_INCREMENT,
ename varchar(50) DEFAULT NULL,
url_data json DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
äºãèæ¬é ç½® 1ãèæ¬itsm_dwd_json.sql [root@t-hadoop01 binlog]# cat itsm_dwd_json.sql CREATE TABLE stg_s9132_order_form_details ( id bigint, ename varchar, url_data varchar ) WITH ( 'connector' = 'binlog-x' ,'username' = 'itsm_repl' ,'password' = 'xxxxx' ,'cat' = 'insert,delete,update' ,'url' = 'jdbc:mysql://172.16.44.7:3306/itsm_db?useSSL=false' ,'host' = '172.16.44.7' ,'port' = '3306' ,'table' = 'itsm_db.test_jons' ,'timestamp-format.standard' = 'SQL' );
CREATE TABLE ods_s9132_order_form_details ( id bigint, ename varchar, url_data varchar, primary key (id) NOT ENFORCED ) WITH ( 'connector' = 'upsert-kafka-x' ,'topic' = 'flinkcdc-mysql' ,'properties.bootstrap.servers' = '172.16.56.254:34715' ,'key.format' = 'json' ,'value.format' = 'json' ,'value.fields-include' = 'ALL' );
insert into ods_s9132_order_form_details select id ,ename ,url_data from stg_s9132_order_form_details a
;
2ãèæ¬itsm_dwd_json2.sql
[root@t-hadoop01 binlog]# cat itsm_dwd_json2.sql
CREATE TABLE ods_s9132_order_form_details
(
id bigint,
ename varchar,
url_data array
CREATE TABLE dwd_itop_order_form_details ( id bigint, ename varchar, url varchar ) WITH ( 'connector' = 'stream-x' );
insert into dwd_itop_order_form_details select a.id ,a.ename ,t.url from ods_s9132_order_form_details a cross join unnest(url_data) as t (url) ;
ä¸ãæ§è¡å½ä»¤
sh bin/chunjun-local.sh -job chunjun-examples/sql/binlog/itsm_dwd_json.sql
sh bin/chunjun-local.sh -job chunjun-examples/sql/binlog/itsm_dwd_json2.sql
åãæä½æ°æ®ï¼éç°é®é¢ 1ãmysqlæºè¡¨æå ¥æ°æ® insert into test_jons(id,ename,url_data) select 4,'phee','["http://json.la/", "http://www.baidu.com/", "https://hub.fastgit.org/"]'
2ãé®é¢æ¥é
Anything else
No response
Version
1.12_release
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct