谢谢
------------------ 原始邮件 ------------------ 发件人: Benchao Li <[hidden email]> 发送时间: 2020年4月10日 09:46 收件人: user-zh <[hidden email]> 主题: 回复:ddl array 创建问题求助 Hi, 1. format.json-schema不需要写,可以去掉; 2. 此外event_time_line的类型应该是array<row<`count` int, rule_name varchar>> 出发 <[hidden email]> 于2020年4月10日周五 上午12:09写道: > 源数据: > { > "types": "pg", > "event_time_line": [{ > "count": 24, > "rule_name": "你好24" > }, > { > "count": 25, > "rule_name": "逆战好25" > > > } > ] > } > > > > DDL: > > > > > > > CREATE TABLE sourceTable ( > &nbsp; &nbsp; types varchar, > event_time_line ROW ( > `rule_name` VARCHAR, > `count` VARCHAR > ), > proctime AS PROCTIME () > ) WITH ( > 'connector.type' = 'kafka', > 'connector.version' = 'universal', > 'connector.startup-mode' = 'earliest-offset', > 'connector.topic' = 'topic_test_1', > 'connector.properties.zookeeper.connect' = 'localhost:2181', > 'connector.properties.bootstrap.servers' = 'localhost:9092', > 'update-mode' = 'append', > 'format.type' = 'json', > 'format.derive-schema' = 'true', > 'format.json-schema' = '{type: "object", properties:&nbsp; > {"types":{type:"string"}},{ "event_time_line": {type:"object", > "properties":&nbsp; > {"rule_name": {type: "string"}}, > &nbsp; &nbsp; "count": {"type": "string"}}}}' > ); > > > > ERROR: > table field 'event_time_line' does not match with the physical type > ROW<`rule_name` STRING&gt; of the 'event_time_line' field of the > TableSource return type. -- Benchao Li School of Electronics Engineering and Computer Science, Peking University Tel:+86-15650713730 Email: [hidden email]; [hidden email] |
Free forum by Nabble | Edit this page |