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 Wayne <17...@163.com> on 2021/08/26 05:18:56 UTC

Flink sql CLI parsing avro format data error 解析avro数据失败

i have Apache Avro schema

我的avro schema 如下

{
  "type" : "record",
  "name" : "KafkaAvroMessage",
  "namespace" : "xxx",
  "fields" : [ {
    "name" : "aaa",
    "type" : "string"
  }, {
    "name" : "bbb",
    "type" : [ "null", "string" ],
    "default" : null

  },{
    "name" : "ccc",
    "type" : [ "null", "string" ]

  },
    {
      "name" : "ddd",
      "type" : "string",
      "default" : ""
    } ]
}

The sql worte is like this
我下的sql如下
CREATE TABLE xxx (
`aaa` STRING NOT NULL,
`bbb` STRING ,
`ccc` STRING NOT NULL,
`ddd` STRING NOT NULL
) WITH(
...
'format' = 'avro'
);

The sql can parse the aaa bbb ddd field correctly,but cannot parse the ccc field. Excuse me,what is the problem with my sql writing,please give me a correct wording
这个sql可以解析 aaa、bbb、ddd 字段,不能解析ccc字段,请问我如果想用flinksql 解析这个schema,正确的写法是什么