You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "swaminathanmanish (via GitHub)" <gi...@apache.org> on 2023/09/26 20:15:25 UTC

[GitHub] [pinot] swaminathanmanish commented on pull request #11682: Using isOptional instead of the deprecated hasOptionalKeyword

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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org