belugabehr commented on a change in pull request #820:
URL: https://github.com/apache/parquet-mr/pull/820#discussion_r497642803



##########
File path: 
parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoWriteSupport.java
##########
@@ -337,6 +337,12 @@ private void writeAllFields(MessageOrBuilder pb) {
         List<FieldDescriptor> fieldDescriptors = messageDescriptor.getFields();
         for (FieldDescriptor fieldDescriptor : fieldDescriptors) {
           FieldDescriptor.Type type = fieldDescriptor.getType();
+
+          //For a field in a oneOf that isn't set don't write anything
+          if (fieldDescriptor.getContainingOneof() != null && 
!pb.hasField(fieldDescriptor)) {
+            continue;
+          }

Review comment:
       What about the read side?  Is there going to be any issue there?  
Currently a value is always written, so there is always a value to read.  With 
this change, the value is not written.  Can the read-side handle this?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to