swaminathanmanish commented on PR #11682: URL: https://github.com/apache/pinot/pull/11682#issuecomment-1736227318
> I'm not an expert in protobuf. Reading about this, it seems to be a common issue to map nulls in proto3. I would say that proto3 designers expected to use `oneof` instead of optional to map null values. That is the protobuf equivalent to `@Nullable T` vs `Optional<T>` in Java. > > I assume we cannot decide to use `oneof` because this is something the customers decide, right? > > For the context, I think https://github.com/protocolbuffers/protobuf/blob/main/docs/field_presence.md and https://github.com/protocolbuffers/protobuf/blob/main/docs/implementing_proto3_presence.md are very useful to understand the problem. We discussed offline. The conclusion is that we go with the proto3 behavior, where addition of 'optional' keyword, helps do the presence check and we can keep the explicitly assigned default. Otherwise a field that has default value explicitly assigned, will fail the presence check and we will treat as null. https://protobuf.dev/programming-guides/proto3/ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
