Flink SQL> insert into upd_sh.dr1 select cast('cid' as string) as cid, cast(2001 as bigint) as server_time, cast('20211027' as string) as dt, cast('01' as str ing) as hour
, cast('7102' as string) as supply_id, cast(map['sid','7102', 'subid', 'i am a subid'] as map<string,string>) as d; [INFO] Submitting SQL update statement to the cluster... [ERROR] Could not execute SQL statement. Reason: org.apache.flink.table.api.ValidationException: Column types of query result and sink for registered table 'hive.upd_sh.dr1' do not match. Cause: Incompatible types for sink column 'd' at position 2.
Query schema: [cid: STRING NOT NULL, server_time: BIGINT NOT NULL, dt: STRING NOT NULL, hour: STRING NOT NULL, supply_id: STRING NOT NULL, d: MAP<STRING, STRING> NOT NULL] Sink schema: [cid: STRING, server_time: BIGINT, d: MAP<STRING, STRING>, dt: STRING, hour: STRING, supply_id: STRING]*来自志愿者整理的flink邮件归档
是字段的顺序不一致(sink schema 里 d 在第三个,query 里 d 在最后)。需要将这两个顺序调整到一致。*来自志愿者整理的FLINK邮件归档
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。