gortiz commented on code in PR #11712: URL: https://github.com/apache/pinot/pull/11712#discussion_r1342465454
########## pinot-plugins/pinot-input-format/pinot-protobuf/src/main/java/org/apache/pinot/plugin/inputformat/protobuf/ProtoBufRecordExtractor.java: ########## @@ -62,7 +62,7 @@ private Object getFieldValue(Descriptors.FieldDescriptor fieldDescriptor, Messag // Note w.r.t proto3 - If a field is not declared with optional keyword, there's no way to distinguish // if its explicitly set to a proto default or not been set at all i.e hasField() returns false // and we would use null. - if (fieldDescriptor.isRepeated() || !fieldDescriptor.isOptional() || message.hasField(fieldDescriptor)) { + if (fieldDescriptor.isRepeated() || !fieldDescriptor.hasOptionalKeyword() || message.hasField(fieldDescriptor)) { Review Comment: It is deprecated in latest versions of protobuf, but: - It is not deprecated in the version we use - There is no alternative to this method in the latest protobuf version. Theoretically we should is `isPresent`, but it is not honoring its javadoc. You can verify that by changing this to `isPresent` and see that it returns false for the test added here. -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org