Hi wanglei,

You don't need to specify 'format.json-schema', the format can derive
schema from the DDL.
Your exception above means the schema in 'format.json-schema' and DDL are
not match.

wangl...@geekplus.com.cn <wangl...@geekplus.com.cn> 于2020年4月16日周四 下午4:21写道:

>
> CREATE TABLE user_log(
>     `id` INT,
>     `timestamp`  BIGINT
> ) WITH (
>     'connector.type' = 'kafka',
>     'connector.version' = 'universal',
>     'connector.topic' = 'wanglei_jsontest',
>     'connector.startup-mode' = 'latest-offset',
>     'connector.properties.0.key' = 'zookeeper.connect',
>     'connector.properties.0.value' = '172.19.78.32:2181',
>     'connector.properties.1.key' = 'bootstrap.servers',
>     'connector.properties.1.value' = '172.19.78.32:9092',
>     'update-mode' = 'append',
>     'format.type' = 'json',
>     'format.json-schema' = '{
>         "type": "object",
>         "properties": {
>            "id": {"type": "integer"},
>            "timestamp": {"type": "number"}
>         }
>     }'
> );
>
> Then select * from user_log;
>
> org.apache.flink.table.api.ValidationException: Type INT of table field
> 'id' does not match with the physical type LEGACY('DECIMAL', 'DECIMAL') of
> the 'id' field of the TableSource return type.
>
> Seems the specified type "integer", "number" can not be mapped to  INT,
> BIGINT
>
> How can i solve this problem?
>
> Thanks,
> Lei
>
> ------------------------------
> wangl...@geekplus.com.cn
>
>

-- 

Benchao Li
School of Electronics Engineering and Computer Science, Peking University
Tel:+86-15650713730
Email: libenc...@gmail.com; libenc...@pku.edu.cn

Reply via email to