Login  Register

Re: flink sql confluent schema avro topic注册成表

Posted by 陈帅 on Dec 18, 2019; 2:45pm
URL: http://apache-flink.370.s1.nabble.com/flink-sql-confluent-schema-avro-topic-tp1264p1278.html

谢谢回复,有了schema registry url为何还需要填subject和avroSchemaStr呢?

朱广彬 <[hidden email]> 于2019年12月18日周三 上午10:30写道:

> Hi 陈帅,
>
> 目前社区确实不支持confluent schema registry的avro格式,我们内部也是依赖schema registry来做avro
> schema的管理,所以,我们改动了flink-avro 的源码来支持。
>
> 主要涉及到这些地方:
>
> org.apache.flink.formats.avro.{AvroRowFormatFactory,AvroRowDeserializationSchema,AvroRowSerializationSchema}
> 和org.apache.flink.table.descriptors.{Avro,AvroValidator}
>
> 使用时在构建Avro时指定以下三个参数即可(见标红部分):
>
> tableEnv.connect(
> new Kafka()
> .version("universal")
> .topic(topic)
> .properties(props)
> ).withFormat(
> new Avro()
>   .useRegistry(true)
>   .registryUrl(KAFKA_SCHEMA_REGISTRY_URL_ADDRESS)
>   .registrySubject(subject)
>   .avroSchema(avroSchemaStr)
> )
>
>
> 陈帅 <[hidden email]> 于2019年12月18日周三 上午8:26写道:
> >
> > flink sql是否能够支持将confluent schema registry注册的一个avro数据格式 的topic注册成一张table?
>