-
Notifications
You must be signed in to change notification settings - Fork 13.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FLINK-11333][protobuf] First-class serializer support for Protobuf types #7598
base: master
Are you sure you want to change the base?
Conversation
…ypes export LD_LIBRARY_PATH
CC @tzulitai would you please review this part of code? |
…to not change current Flink build behavior
To not change current Flink's build prerequisites, I add the generated protobuf message |
Any expected timeline for this feature? Would really like to use this instead of having to register custom protobuf serializer/deserializer. Thanks! |
@Myasuka Any idea if and when this might be merged? |
@nitinpandey-154 @elliotvilhelm Thanks for you watch. |
When would this be merged? |
For anyone interested in this issue, I've implemented a first-class Protobuf support for Apache Flink as a separate library: https://github.com/findify/flink-protobuf It works both with protobuf-java and ScalaPB generated classes. As a usage example, given that you have a following message format: message Foo {
required int32 value = 1;
} You can build a TypeInformation for scalapb-generated classes like this: import io.findify.flinkpb.FlinkProtobuf
implicit val ti = FlinkProtobuf.generateScala(Foo)
val result = env.fromCollection(List(Foo(1), Foo(2), Foo(3))) For Java it's going to look a bit different: import io.findify.flinkprotobuf.java.Tests;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
TypeInformation<Tests.Foo> ti = FlinkProtobuf.generateJava(Tests.Foo.class, Tests.Foo.getDefaultInstance());
env.fromCollection(List.of(Tests.Foo.newBuilder().setValue(1).build()), ti).executeAndCollect(100); The main motivation for this library was our own use case when:
With this one we can just rely on protobuf to handle all the problematic cases. |
Any updates regarding this one? |
@tzulitai @MartijnVisser this would be great for Flink 2.0 |
What is the purpose of the change
Support Protobuf types directly in Flink. Unlike the built-in avro serializer of Flink, check whether schema evolvable left to Protobuf itself not checking before any code running currently. This is a known limitation and recorded in FLINK-11333's comments.
Brief change log
ProtobufTypeInfo
withinTypeExtractor
.chill-protobuf
and Kryo.ProtobufSeriazlier
Verifying this change
This change added tests and can be verified as follows:
ProtobufTypeInfo
,ProtobufSeriazlier
andProtobufSeriazlierSnapshot
.ProtobufSeriazlier
.Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation