[ 
https://issues.apache.org/jira/browse/FLINK-29370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17607690#comment-17607690
 ] 

Benchao Li commented on FLINK-29370:
------------------------------------

We indeed have one version that do not need users provide their compiled 
classes internally. It's using {{DynamicMessage}} which is mentioned as the 
first way to implement ProtoBuf Format in FLINK-18202. We used 'wire-schema' to 
do the schema parsing, and translate it to {{DynamicMessage}}, which is similar 
to [confluentinc's 
schema-registry|https://github.com/confluentinc/schema-registry/blob/master/protobuf-provider/src/main/java/io/confluent/kafka/schemaregistry/protobuf/ProtobufSchema.java]

However, we chose 2nd way (codegen to use classes and builders compiled by 
protoc) to implement ProtoBuf Format now, and this is hard to avoid user 
providing compiled classes AFAIK.

If anyone knows there is some way which we can achieve that, I think it will be 
worth to have a try.

> Protobuf in flink-sql-protobuf is not shaded
> --------------------------------------------
>
>                 Key: FLINK-29370
>                 URL: https://issues.apache.org/jira/browse/FLINK-29370
>             Project: Flink
>          Issue Type: Bug
>          Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile)
>    Affects Versions: 1.16.0
>            Reporter: Jark Wu
>            Priority: Blocker
>             Fix For: 1.16.0, 1.17.0
>
>
> The protobuf classes in flink-sql-protobuf is not shaded which may lead to 
> class conflicts. Usually, sql jars should shade common used dependencies, 
> e.g. flink-sql-avro: 
> https://github.com/apache/flink/blob/master/flink-formats/flink-sql-avro/pom.xml#L88
>  
> {code}
> ➜  Downloads jar tvf flink-sql-protobuf-1.16.0.jar | grep com.google
>      0 Tue Sep 13 20:23:44 CST 2022 com/google/
>      0 Tue Sep 13 20:23:44 CST 2022 com/google/protobuf/
>    568 Tue Sep 13 20:23:44 CST 2022 
> com/google/protobuf/ProtobufInternalUtils.class
>  19218 Tue Sep 13 20:23:44 CST 2022 
> com/google/protobuf/AbstractMessage$Builder.class
>    259 Tue Sep 13 20:23:44 CST 2022 
> com/google/protobuf/AbstractMessage$BuilderParent.class
>  10167 Tue Sep 13 20:23:44 CST 2022 com/google/protobuf/AbstractMessage.class
>   1486 Tue Sep 13 20:23:44 CST 2022 
> com/google/protobuf/AbstractMessageLite$Builder$LimitedInputStream.class
>  12399 Tue Sep 13 20:23:44 CST 2022 
> com/google/protobuf/AbstractMessageLite$Builder.class
>    279 Tue Sep 13 20:23:44 CST 2022 
> com/google/protobuf/AbstractMessageLite$InternalOneOfEnu
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to